class_docstr: Wrapper for a TransformerDecoder that will unflatten/flatten the incremental state.
  
  Unflattening/flattening will occur before passing the incremental state into and out
  of .forward().
code: def forward(
      self,
      input_: torch.LongTensor,
      encoder_state: Tuple[torch.Tensor, torch.Tensor],
      flat_incr_state: Optional[Dict[str, torch.Tensor]] = None,
  ) -> Tuple[torch.Tensor, Dict[str, torch.Tensor]]:
      if flat_incr_state is not None:
          structured_incr_state = self._unflatten_incr_state(
              flat_incr_state
          )
      else:
          structured_incr_state = None
      tensor, new_structured_incr_state = self.module.forward(
          input=input_,
          encoder_state=encoder_state,
          incr_state=structured_incr_state,
      )
      new_flat_incr_state = self._flatten_incr_state(
          new_structured_incr_state
      )
      return tensor, new_flat_incr_state
  
imports: from collections import defaultdict
  from typing import Dict, List, Optional, Tuple
  import torch.jit
  from parlai.agents.bart.bart import BartAgent
  from parlai.core.dict import DictionaryAgent
  from parlai.core.torch_agent import TorchAgent
  from parlai.utils.bpe import Gpt2BpeHelper, SubwordBPEHelper
  from parlai.torchscript.tokenizer import ScriptableDictionaryAgent
  from torch import nn
label_desc: Use image node_id 1 for calling the DecoderIncrStateFlattener obj's underlying member method code with example usage: obj.forward(input_, encoder_state, flat_incr_state) and returns: tensor,  new_flat_incr_state