code: def __call__(self, align_scores, **kargs):
      # note: we reuse the same shape as cls head in BERT (batch_size, 2)
      # but NCE only needs one logits.
      # (so we drop all weights in the second neg logits.)
      align_scores = align_scores[:, :1]
      # duplicate negative examples
      batch_size = align_scores.size(0) // 2
      pos_scores = align_scores[:batch_size]
      neg_scores = (
          align_scores[batch_size:]
          .view(1, batch_size)
          .repeat(batch_size, 1)
      )
      scores = torch.cat([pos_scores, neg_scores], dim=1)
      return self.loss(
          scores,
          torch.zeros(
              (batch_size,),
              dtype=torch.long,
              device=align_scores.device,
          ),
      )
  
imports: import torch
  from torch import nn
  from .loss import Loss
label_desc: Use image node_id 2 for calling the NCE obj's underlying member method code with example usage: obj.__call__(align_scores) and returns: self