class_docstr: Override basic attention to account for edge case for polyencoder.
class_docstr_tok: ["Override","basic","attention","to","account","for","edge","case","for","polyencoder","."]
code: def __init__(self, poly_type, n_codes, *args, **kwargs):
      super().__init__(*args, **kwargs)
      self.poly_type = poly_type
      self.n_codes = n_codes
  
imports: from parlai.core.params import ParlaiParser
  from typing import Any, Dict, Optional, Tuple
  import torch
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.core.torch_agent import Batch
  from parlai.utils.misc import recursive_getattr
  from parlai.utils.logging import logging
  from .biencoder import AddLabelFixedCandsTRA
  from .modules import BasicAttention, MultiHeadAttention, TransformerEncoder
  from .transformer import TransformerRankerAgent
label_desc: Use image node_id 1 to create a new PolyBasicAttention object from inherited base classes: BasicAttention with example: obj = PolyBasicAttention(poly_type, n_codes)