class_docstr: HRED model that has a context LSTM layer.
class_docstr_tok: ["HRED","model","that","has","a","context","LSTM","layer","."]
code: def reorder_decoder_incremental_state(self, incremental_state, inds):
      if torch.is_tensor(incremental_state):
          # gru or vanilla rnn
          return torch.index_select(
              incremental_state, 0, inds
          ).contiguous()
      elif isinstance(incremental_state, tuple):
          return tuple(
              self.reorder_decoder_incremental_state(x, inds)
              for x in incremental_state
          )
  
file_path: ParlAI/parlai/agents/hred/modules.py
imports: import torch
  import torch.nn
  from parlai.agents.seq2seq.modules import OutputLayer, RNNEncoder, _transpose_hidden_state
  from parlai.core.torch_generator_agent import TorchGeneratorModel
label_desc: Use image node_id 3 for calling the HredModel obj's underlying member method code with example usage: obj.reorder_decoder_incremental_state(incremental_state, inds) and returns: torch, tuple