class_docstr: DecoderOnlyAgent.
  
  Implementation of TorchGeneratorAgent, where the model is a Decoder-Only
  Transformer.
class_docstr_tok: ["DecoderOnlyAgent",".","Implementation","of","TorchGeneratorAgent",",","where","the","model","is","a","Decoder-Only","Transformer","."]
docstr: Override of ``TorchAgent._pad_tensor``.
  
  Pads context tensor on the left and label tensor on the right, such that when
  they are concatenated the example meets in the middle to form a continuous
  sequence.
docstr_tok: ["Override","of","``","TorchAgent._pad_tensor","``",".","Pads","context","tensor","on","the","left","and","label","tensor","on","the","right",",","such","that","when","they","are","concatenated","the","example","meets","in","the","middle","to","form","a","continuous","sequence","."]
code: def _pad_tensor(self, items, is_label=False):
      """
      Override of ``TorchAgent._pad_tensor``.
  
      Pads context tensor on the left and label tensor on the right, such that when
      they are concatenated the example meets in the middle to form a continuous
      sequence.
      """
      return padded_tensor(
          items,
          pad_idx=self.NULL_IDX,
          left_padded=(not is_label),
          fp16friendly=self.fp16,
      )
  
file_path: ParlAI/parlai/agents/transformer/decoder.py
imports: from typing import Optional
  from parlai.agents.transformer.transformer import add_common_cmdline_args
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_generator_agent import TorchGeneratorAgent
  from parlai.utils.logging import logging
  from parlai.utils.misc import recursive_getattr
  from parlai.utils.torch import padded_tensor
  from .modules import PassThroughEncoder, TransformerDecoderOnly, TransformerGeneratorModel
label_desc: Use image node_id 3 for calling the DecoderAgent obj's underlying member method code with example usage: obj._pad_tensor(items, is_label) and returns: padded_tensor