code: def __init__(self, b, alpha, anneal, variant, bs, classes):
      super(OriginalImplementationPNP, self).__init__()
      self.b = b
      self.alpha = alpha
      self.anneal = anneal
      self.variant = variant
      self.batch_size = bs
      self.num_id = classes
      self.samples_per_class = int(bs / classes)
  
      mask = 1.0 - torch.eye(self.batch_size)
      for i in range(self.num_id):
          mask[
              i
              * (self.samples_per_class) : (i + 1)
              * (self.samples_per_class),
              i
              * (self.samples_per_class) : (i + 1)
              * (self.samples_per_class),
          ] = 0
  
      self.mask = mask.unsqueeze(dim=0).repeat(self.batch_size, 1, 1)
  
file_path: pytorch-metric-learning/tests/losses/test_pnp_loss.py
imports: import unittest
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.nn.functional
  from pytorch_metric_learning.losses import PNPLoss
  from ..None import TEST_DEVICE, TEST_DTYPES
label_desc: Use image node_id 1 to create a new OriginalImplementationPNP object from inherited base classes: torch.nn with example: obj = OriginalImplementationPNP(b, alpha, anneal, variant, bs, classes)