class_docstr: LSTM decoder.
class_docstr_tok: ["LSTM","decoder","."]
code: def reorder_incremental_state(self, incremental_state, new_order):
      super().reorder_incremental_state(incremental_state, new_order)
      cached_state = utils.get_incremental_state(
          self, incremental_state, "cached_state"
      )
      if cached_state is None:
          return
  
      def reorder_state(state):
          if isinstance(state, list):
              return [reorder_state(state_i) for state_i in state]
          return state.index_select(0, new_order)
  
      new_state = tuple(map(reorder_state, cached_state))
      utils.set_incremental_state(
          self, incremental_state, "cached_state", new_state
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import options, utils
  from fairseq.models import FairseqEncoder, FairseqIncrementalDecoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
label_desc: Use image node_id 3 for calling the LSTMDecoder obj's underlying member method code with example usage: obj.reorder_incremental_state(incremental_state, new_order) and returns: state, unknown