code: def forward(self, cosine, label):
      index = torch.where(label != -1)[0]
      m_hot = torch.zeros(
          index.size()[0], cosine.size()[1], device=cosine.device
      )
      m_hot.scatter_(1, label[index, None], self.m)
      cosine[index] -= m_hot
      ret = cosine * self.s
      return ret
  
file_path: insightface/recognition/vpl/losses.py
imports: import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the CosFace obj's underlying member method code with example usage: obj.forward(cosine, label) and returns: ret