import torch


def generate_label(t_model, graph, feats, device):
    """This is the function that generates the logits for the unlabeled data from the pre-trained teacher GNNs

    Args:
        t_model (nn.Module): the pre-trained teacher GNN models
        graph (DGLGraph): the input graphs containing the topological information
        feats (torch.Tensor): the input node features
        device (torch.device): device to place the pytorch tensor

    Returns:
        torch.Tensor: logits of the teacher GNNs
    """
    
    t_model.eval()

    with torch.no_grad():
        t_model.g = graph
        for layer in t_model.gat_layers:
            layer.g = graph
    
        # generate logits from the pre-trained teacher models
        logits_t = t_model(feats.float())

    return logits_t.detach()