class_docstr: Groups context_encoder and cand_encoder together.
code: def __init__(self, opt):
      super(BiEncoderModule, self).__init__()
      self.context_encoder = BertWrapper(
          BertModel.from_pretrained(opt["pretrained_path"]),
          opt["out_dim"],
          add_transformer_layer=opt["add_transformer_layer"],
          layer_pulled=opt["pull_from_layer"],
          aggregation=opt["bert_aggregation"],
      )
      self.cand_encoder = BertWrapper(
          BertModel.from_pretrained(opt["pretrained_path"]),
          opt["out_dim"],
          add_transformer_layer=opt["add_transformer_layer"],
          layer_pulled=opt["pull_from_layer"],
          aggregation=opt["bert_aggregation"],
      )
  
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
  from parlai.utils.torch import padded_3d
  from parlai.zoo.bert.build import download
  from parlai.utils.io import PathManager
  from .bert_dictionary import BertDictionaryAgent
  from .helpers import BertWrapper, BertModel, add_common_args, surround, MODEL_PATH
  import os
  import torch
  from tqdm import tqdm
label_desc: Use image node_id 1 to create a new BiEncoderModule object from inherited base classes: torch.nn with example: obj = BiEncoderModule(opt)