class_docstr: Computes the scores of the model embeddings against the `positive'
  and `negative' samples from the Memory Bank.
  This class does *NOT* compute the actual loss, just the scores,
  i.e., inner products followed by normalizations/exponentiation etc.
class_docstr_tok: ["Computes","the","scores","of","the","model","embeddings","against","the","`","positive'","and","`","negative","'","samples","from","the","Memory","Bank",".","This","class","does","*","NOT","*","compute","the","actual","loss",",","just","the","scores",",","i.e.",",","inner","products","followed","by","normalizations\/exponentiation","etc","."]
code: def do_negative_sampling(self, embedding, y, num_negatives):
      with torch.no_grad():
          if self.negative_sampling_params.type in ["random", "debug"]:
              batchSize = embedding.shape[0]
              idx = self.multinomial.draw(
                  batchSize * (num_negatives + 1)
              ).view(batchSize, -1)
              idx.select(1, 0).copy_(y.data)
      return idx
  
imports: import logging
  import math
  import pprint
  from typing import List, Union
  import numpy
  import torch
  from classy_vision.generic.distributed_util import all_reduce_mean, gather_from_all, get_rank
  from classy_vision.generic.util import is_pos_int
  from classy_vision.losses import ClassyLoss, register_loss
  from torch import nn
  from vissl.config import AttrDict
label_desc: Use image node_id 4 for calling the NCEAverage obj's underlying member method code with example usage: obj.do_negative_sampling(embedding, y, num_negatives) and returns: idx