class_docstr: Poly-encoder model with image features.
  
  Model that allows encoding image features and adding or concatenating them to the
  context encoding.
class_docstr_tok: ["Poly-encoder","model","with","image","features",".","Model","that","allows","encoding","image","features","and","adding","or","concatenating","them","to","the","context","encoding","."]
docstr: Return the batch size of the context.
docstr_tok: ["Return","the","batch","size","of","the","context","."]
code: def _get_context_batch_size(self, **ctxt_inputs: torch.Tensor) -> int:
      """
      Return the batch size of the context.
      """
      if ctxt_inputs["ctxt_tokens"] is not None:
          return ctxt_inputs["ctxt_tokens"].size(0)
      else:
          return ctxt_inputs["ctxt_image"].size(0)
  
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 3 for calling the ImagePolyencoderModule obj's underlying member method code with example usage: obj._get_context_batch_size() and returns: ctxt_inputs, ctxt_inputs