code: def forward(self, logits, labels):
      index_positive = torch.where(labels != -1)[0]
  
      if self.interclass_filtering_threshold > 0:
          with torch.no_grad():
              dirty = logits > self.interclass_filtering_threshold
              dirty = dirty.float()
              mask = torch.ones(
                  [index_positive.size(0), logits.size(1)],
                  device=logits.device,
              )
              mask.scatter_(1, labels[index_positive], 0)
              dirty[index_positive] *= mask
              tensor_mul = 1 - dirty
          logits = tensor_mul * logits
  
      target_logit = logits[
          index_positive, labels[index_positive].view(-1)
      ]
  
      if self.m1 == 1.0 and self.m3 == 0.0:
          with torch.no_grad():
              target_logit.arccos_()
              logits.arccos_()
              final_target_logit = target_logit + self.m2
              logits[
                  index_positive, labels[index_positive].view(-1)
              ] = final_target_logit
              logits.cos_()
          logits = logits * self.s
  
      elif self.m3 > 0:
          final_target_logit = target_logit - self.m3
          logits[
              index_positive, labels[index_positive].view(-1)
          ] = final_target_logit
          logits = logits * self.s
      else:
          raise
  
      return logits
  
file_path: insightface/recognition/arcface_torch/losses.py
imports: import torch
  import math
label_desc: Use image node_id 2 for calling the CombinedMarginLoss obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: logits