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 forward(self, query_vecs: torch.LongTensor) -> torch.Tensor:
      if self.use_codes:
          ctxt_rep, ctxt_mask, _ = self.model(ctxt_tokens=query_vecs)  # type: ignore
      else:
          model = (
              self.model.module
              if hasattr(self.model, "module")
              else self.model
          )
          old_type = model.type
          model.type = "n_first"  # type: ignore
  
          ctxt_rep, ctxt_mask, _ = self.model(ctxt_tokens=query_vecs)  # type: ignore
          model.type = old_type  # type: ignore
  
      ctxt_rep = reduce_ctxt(ctxt_rep, ctxt_mask, self.reduction_type)
      return ctxt_rep
  
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 3 for calling the RagDropoutPolyWrapper obj's underlying member method code with example usage: obj.forward(query_vecs) and returns: ctxt_rep