class_docstr: Poly-encoder Agent that ingests image features.
  
  Agent that allows encoding image features and adding or concatenating them to the
  context encoding.
class_docstr_tok: ["Poly-encoder","Agent","that","ingests","image","features",".","Agent","that","allows","encoding","image","features","and","adding","or","concatenating","them","to","the","context","encoding","."]
docstr: Add command-line arguments specifically for this agent.
docstr_tok: ["Add","command-line","arguments","specifically","for","this","agent","."]
code: def add_cmdline_args(
      cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
  ) -> ParlaiParser:
      """
      Add command-line arguments specifically for this agent.
      """
      PolyencoderAgent.add_cmdline_args(parser, partial_opt=partial_opt)
      TorchImageAgent.add_cmdline_args(parser, partial_opt=partial_opt)
      agent = parser.add_argument_group("ImagePolyencoder Args")
      agent.add_argument(
          "--image-combination-mode",
          type=str,
          default="prepend",
          choices=["add", "append", "prepend"],
          help="How to combine image embedding (if used) with context embedding",
      )
      # TODO: more thoroughly test out whether one of these choices is best and add a
      #  'recommended' arg here. 'add' and 'prepend' seem to be roughly similar in
      #  performance
      agent.set_defaults(reduction_type=None)
      # This agent doesn't support any encoder output reductions
      return agent
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from typing import Any, Dict
  import torch
  from parlai.agents.image_seq2seq.modules import ContextWithImageEncoder
  from parlai.agents.transformer.polyencoder import PolyencoderAgent, PolyEncoderModule
  from parlai.core.torch_agent import Batch
  from parlai.core.torch_image_agent import TorchImageAgent
  from parlai.utils.misc import warn_once
label_desc: Use image node_id 1 for calling the ImagePolyencoderAgent obj's underlying member method code with example usage: obj.add_cmdline_args(cls, parser, partial_opt) and returns: agent