class_docstr: TorchRankerAgent implementation of the crossencoder.
  
  It is a standalone Agent. It might be called by the Both Encoder.
class_docstr_tok: ["TorchRankerAgent","implementation","of","the","crossencoder",".","It","is","a","standalone","Agent",".","It","might","be","called","by","the","Both","Encoder","."]
code: def __init__(self, opt, shared=None):
      # download pretrained models
      download(opt["datapath"])
      self.pretrained_path = os.path.join(
          opt["datapath"], "models", "bert_models", MODEL_PATH
      )
  
      super().__init__(opt, shared)
      # it's easier for now to use DataParallel when
      self.clip = -1
      self.NULL_IDX = self.dict.pad_idx
      self.START_IDX = self.dict.start_idx
      self.END_IDX = self.dict.end_idx
  
file_path: ParlAI/parlai/agents/bert_ranker/cross_encoder_ranker.py
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.utils.torch import concat_without_padding
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.zoo.bert.build import download
  from .bert_dictionary import BertDictionaryAgent
  from .helpers import BertWrapper, BertModel, add_common_args, surround, MODEL_PATH
  import os
label_desc: Use image node_id 2 to create a new CrossEncoderRankerAgent object from inherited base classes: TorchRankerAgent with example: obj = CrossEncoderRankerAgent(opt, shared)