code: def _one_hot_embedding(labels, num_classes):
      """Embedding labels to one-hot form.
  
      Args:
        labels: (LongTensor) class labels, sized [N,].
        num_classes: (int) number of classes.
  
      Returns:
        (tensor) encoded labels, sized [N, #classes].
      """
  
      y = torch.eye(num_classes).cuda()
      return y[labels].permute(0, 3, 1, 2)
  
file_path: pywick/pywick/models/segmentation/testnets/gscnn/my_functionals/DualTaskLoss.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from .custom_functional import compute_grad_mag
label_desc: Use image node_id 4 for calling a global function with example usage: _one_hot_embedding(labels, num_classes) and returns: y