class_docstr: Example subclass of TorchRankerAgent.
  
  This particular implementation is a simple bag-of-words model, which demonstrates
  the minimum implementation requirements to make a new ranking model.
docstr: This function takes in a Batch object as well as a Tensor of candidate vectors.
  
  It must return a list of scores corresponding to the likelihood that the
  candidate vector at that index is the proper response. If `cand_encs` is not
  None (when we cache the encoding of the candidate vectors), you may use these
  instead of calling self.model on `cand_vecs`.
docstr_tok: ["This","function","takes","in","a","Batch","object","as","well","as","a","Tensor","of","candidate","vectors",".","It","must","return","a","list","of","scores","corresponding","to","the","likelihood","that","the","candidate","vector","at","that","index","is","the","proper","response",".","If","`","cand_encs","`","is","not","None","(","when","we","cache","the","encoding","of","the","candidate","vectors",")",",","you","may","use","these","instead","of","calling","self.model","on","`","cand_vecs","`","."]
code: def score_candidates(self, batch, cand_vecs, cand_encs=None):
      """
      This function takes in a Batch object as well as a Tensor of candidate vectors.
  
      It must return a list of scores corresponding to the likelihood that the
      candidate vector at that index is the proper response. If `cand_encs` is not
      None (when we cache the encoding of the candidate vectors), you may use these
      instead of calling self.model on `cand_vecs`.
      """
      scores = self.model.forward(batch, cand_vecs, cand_encs)
      return scores
  
file_path: ParlAI/parlai/agents/examples/tra.py
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the TraAgent obj's underlying member method code with example usage: obj.score_candidates(batch, cand_vecs, cand_encs) and returns: scores