code: def sample_negatives(self, y, num):
      # y - T'xBxC or T'xC
  
      high = y.shape[0]
      neg_idxs = torch.multinomial(
          torch.ones((num, high), device=y.device), self.num_negatives
      )
  
      negs = y[neg_idxs.view(-1)]
      negs = negs.view((num, self.num_negatives) + y.shape[1:])
      negs = negs.transpose(0, 1)
      # negs - NxT'xBxC or NxT'xC
  
      return negs, neg_idxs
  
file_path: NeMo/nemo/collections/asr/losses/ssl_losses/contrastive.py
imports: import torch
  import torch.nn.functional
  from torch import nn
  from nemo.core import Loss, typecheck
  from nemo.core.neural_types import AcousticEncodedRepresentation, LengthsType, LossType, NeuralType, SpectrogramType
label_desc: Use image node_id 5 for calling the ContrastiveLoss obj's underlying member method code with example usage: obj.sample_negatives(y, num) and returns: negs,  neg_idxs