class_docstr: TRA Wrapper for the DPR Models.
class_docstr_tok: ["TRA","Wrapper","for","the","DPR","Models","."]
code: def __init__(self, opt, shared=None):
      config: BertConfig = BertConfig.from_pretrained(
          "bert-base-uncased"
      )
      opt["n_heads"] = config.num_attention_heads
      opt["n_layers"] = config.num_hidden_layers
      opt["embedding_size"] = config.hidden_size
      opt["ffn_size"] = config.intermediate_size
      opt["dropout"] = config.hidden_dropout_prob
      opt["attention_dropout"] = config.attention_probs_dropout_prob
      opt["reduction_type"] = "first"
      opt["n_positions"] = config.max_position_embeddings
      opt["activation"] = config.hidden_act
      opt["variant"] = "xlm"
      opt["n_segments"] = config.type_vocab_size
      super().__init__(opt, shared)
  
imports: from parlai.agents.transformer.transformer import TransformerRankerAgent
  from parlai.agents.transformer.modules import TransformerMemNetModel, TransformerEncoder
  from parlai.agents.hugging_face.dict import HuggingFaceDictionaryAgent
  from parlai.agents.rag.args import DPR_ZOO_MODEL
  from parlai.agents.rag.conversion_utils import BertConversionUtils
  from parlai.core.build_data import modelzoo_path
  from parlai.core.dict import DictionaryAgent
  from parlai.core.loader import register_agent
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  import os
  import torch
  import torch.cuda
  import torch.nn
  from transformers import BertConfig
  from typing import Dict, Optional
label_desc: Use image node_id 1 to create a new DPRAgent object from inherited base classes: TransformerRankerAgent with example: obj = DPRAgent(opt, shared)