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 __init__(
      self,
      memory_params,
      negative_sampling_params,
      T=0.07,
      Z=-1,
      loss_type="nce",
  ):
      super(NCEAverage, self).__init__()
      self.nLem = memory_params.memory_size
      self.loss_type = loss_type
      self.setup_negative_sampling(negative_sampling_params)
      self.init_memory(memory_params)
      self.register_buffer(
          "params",
          torch.tensor(
              [
                  self.negative_sampling_params.num_negatives,
                  T,
                  Z,
                  self.memory_params.momentum,
              ]
          ),
      )
  
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 1 to create a new NCEAverage object from inherited base classes: nn with example: obj = NCEAverage(memory_params, negative_sampling_params, T, Z, loss_type)