class_docstr: Poly-encoder model.
  
  See https://arxiv.org/abs/1905.01969 for more details
class_docstr_tok: ["Poly-encoder","model",".","See","https",":","\/\/arxiv.org\/abs\/1905.01969","for","more","details"]
docstr: Score the candidates.
  
  :param ctxt_rep:
      3D float tensor, bsz x ctxt_len x dim
  :param ctxt_rep_mask:
      2D byte tensor, bsz x ctxt_len, in case there are some elements
      of the ctxt that we should not take into account.
  :param cand_embed: 3D float tensor, bsz x num_cands x dim
  
  :return: scores, 2D float tensor: bsz x num_cands
docstr_tok: ["Score","the","candidates",".",":","param","ctxt_rep",":","3D","float","tensor",",","bsz","x","ctxt_len","x","dim",":","param","ctxt_rep_mask",":","2D","byte","tensor",",","bsz","x","ctxt_len",",","in","case","there","are","some","elements","of","the","ctxt","that","we","should","not","take","into","account",".",":","param","cand_embed",":","3D","float","tensor",",","bsz","x","num_cands","x","dim",":","return",":","scores",",","2D","float","tensor",":","bsz","x","num_cands"]
code: def score(self, ctxt_rep, ctxt_rep_mask, cand_embed):
      """
      Score the candidates.
  
      :param ctxt_rep:
          3D float tensor, bsz x ctxt_len x dim
      :param ctxt_rep_mask:
          2D byte tensor, bsz x ctxt_len, in case there are some elements
          of the ctxt that we should not take into account.
      :param cand_embed: 3D float tensor, bsz x num_cands x dim
  
      :return: scores, 2D float tensor: bsz x num_cands
      """
      # reduces the context representation to a 3D tensor bsz x num_cands x dim
      ctxt_final_rep = self.attend(
          self.attention, cand_embed, ctxt_rep, ctxt_rep, ctxt_rep_mask
      )
      scores = torch.sum(ctxt_final_rep * cand_embed, 2)
      return scores
  
imports: from parlai.core.params import ParlaiParser
  from typing import Any, Dict, Optional, Tuple
  import torch
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.core.torch_agent import Batch
  from parlai.utils.misc import recursive_getattr
  from parlai.utils.logging import logging
  from .biencoder import AddLabelFixedCandsTRA
  from .modules import BasicAttention, MultiHeadAttention, TransformerEncoder
  from .transformer import TransformerRankerAgent
label_desc: Use image node_id 8 for calling the PolyEncoderModule obj's underlying member method code with example usage: obj.score(ctxt_rep, ctxt_rep_mask, cand_embed) and returns: scores