code: def compute_loss(logits, y, eps=0.2):
      num_classes = logits.shape[1]
      one_hot = torch.zeros_like(logits).scatter_(1, y.view(-1, 1), 1)
      one_hot = one_hot * (1 - eps) + (1 - one_hot) * eps / (
          num_classes - 1
      )
      log_prob = F.log_softmax(logits, 1)
      loss = -(one_hot * log_prob).sum(1).mean()
      return loss
  
file_path: dgl/examples/pytorch/pointcloud/edgeconv/model.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import EdgeConv, KNNGraph
label_desc: Use image node_id 1 for calling a global function with example usage: compute_loss(logits, y, eps) and returns: loss