class_docstr: Wrapper for a DropoutPoly agent.
  
  Provides interface to RagModel as query/document encoder (separate), and provides
  interface to retrievers as a full poly-encoder.
class_docstr_tok: ["Wrapper","for","a","DropoutPoly","agent",".","Provides","interface","to","RagModel","as","query\/document","encoder","(","separate",")",",","and","provides","interface","to","retrievers","as","a","full","poly-encoder","."]
code: def __init__(self, opt: Opt):
      super().__init__()
      self.model, self.dict = self._build_model(opt)
      model_file = modelzoo_path(
          opt["datapath"], opt["poly_faiss_model_file"]
      )
      model_opt = Opt.load(f"{model_file}.opt")
      self.reduction_type = model_opt["poly_dropout_reduction_type"]
      self.use_codes = model_opt.get("poly_dropout_use_codes", True)
  
file_path: ParlAI/parlai/agents/rag/polyfaiss.py
imports: import torch
  import torch.cuda
  import torch.nn
  from typing import Tuple
  from parlai.agents.transformer.polyencoder import PolyEncoderModule
  from parlai.core.agents import create_agent
  from parlai.core.build_data import modelzoo_path
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  import parlai.utils.logging
  from parlai.agents.transformer.dropout_poly import DropoutPolyAgent, reduce_ctxt
  from parlai.agents.rag.args import POLYENCODER_OPT_KEYS, TRANSFORMER_RANKER_BASE_OPT
label_desc: Use image node_id 1 to create a new RagDropoutPolyWrapper object from inherited base classes: torch.nn with example: obj = RagDropoutPolyWrapper(opt)