class_docstr: Dropout Polyencoder Agent.
  
  Overrides score_candidates to, sometimes, score candidates in the bi-encoder method.
docstr: Score context with candidates.
  
  During training, with some probability we fall back to the Bi-encoder scoring
  method.
docstr_tok: ["Score","context","with","candidates",".","During","training",",","with","some","probability","we","fall","back","to","the","Bi-encoder","scoring","method","."]
code: def get_scores(
      self,
      ctxt_rep: torch.Tensor,
      ctxt_rep_mask: torch.BoolTensor,
      cand_rep: torch.Tensor,
  ) -> torch.Tensor:
      """
      Score context with candidates.
  
      During training, with some probability we fall back to the Bi-encoder scoring
      method.
      """
      if self.is_training and random.random() < self.poly_dropout_prob:
          ctxt_rep = reduce_ctxt(
              ctxt_rep, ctxt_rep_mask, self.poly_dropout_reduction_type
          )
          scores = torch.bmm(
              ctxt_rep.unsqueeze(1), cand_rep.transpose(1, 2)
          ).squeeze(1)
      else:
          scores = self.model(
              ctxt_rep=ctxt_rep,
              ctxt_rep_mask=ctxt_rep_mask,
              cand_rep=cand_rep,
          )
      return scores
  
file_path: ParlAI/parlai/agents/transformer/dropout_poly.py
imports: from parlai.core.params import ParlaiParser
  from parlai.agents.transformer.polyencoder import PolyencoderAgent
  from parlai.core.opt import Opt
  from parlai.core.torch_agent import Batch
  import random
  import torch
  from typing import Optional, Tuple
label_desc: Use image node_id 4 for calling the DropoutPolyAgent obj's underlying member method code with example usage: obj.get_scores(ctxt_rep, ctxt_rep_mask, cand_rep) and returns: scores