code: def forward(self, logits, labels):
      one_hot = (
          torch.zeros_like(logits)
          .scatter_(1, labels.view(-1, 1), 1.0)
          .cuda()
      )
      phi = logits - self.m
      output = torch.where(one_hot == 1, phi, logits)
      output *= self.s
  
      return output
  
file_path: insightface/recognition/idmmd/losses.py
imports: import torch
  from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the CosFace obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: output