class_docstr: ExampleModel implements the abstract methods of TorchGeneratorModel to define how to
  re-order encoder states and decoder incremental states.
  
  It also instantiates the embedding table, encoder, and decoder, and defines the
  final output layer.
class_docstr_tok: ["ExampleModel","implements","the","abstract","methods","of","TorchGeneratorModel","to","define","how","to","re-order","encoder","states","and","decoder","incremental","states",".","It","also","instantiates","the","embedding","table",",","encoder",",","and","decoder",",","and","defines","the","final","output","layer","."]
docstr: Reorder the decoder states to select only the given batch indices.
  
  This method can be a stub which always returns None; this will result in the
  decoder doing a complete forward pass for every single token, making generation
  O(n^2). However, if any state can be cached, then this method should be
  implemented to reduce the generation complexity to O(n).
docstr_tok: ["Reorder","the","decoder","states","to","select","only","the","given","batch","indices",".","This","method","can","be","a","stub","which","always","returns","None",";","this","will","result","in","the","decoder","doing","a","complete","forward","pass","for","every","single","token",",","making","generation","O","(","n^2",")",".","However",",","if","any","state","can","be","cached",",","then","this","method","should","be","implemented","to","reduce","the","generation","complexity","to","O","(","n",")","."]
code: def reorder_decoder_incremental_state(self, incr_state, indices):
      """
      Reorder the decoder states to select only the given batch indices.
  
      This method can be a stub which always returns None; this will result in the
      decoder doing a complete forward pass for every single token, making generation
      O(n^2). However, if any state can be cached, then this method should be
      implemented to reduce the generation complexity to O(n).
      """
      h, c = incr_state
      return h[:, indices, :], c[:, indices, :]
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import torch.nn
  import torch.nn.functional
  import parlai.core.torch_generator_agent
label_desc: Use image node_id 4 for calling the ExampleModel obj's underlying member method code with example usage: obj.reorder_decoder_incremental_state(incr_state, indices) and returns: h,  c