class_docstr: LSTM encoder.
class_docstr_tok: ["LSTM","encoder","."]
code: def reorder_encoder_out(self, encoder_out_dict, new_order):
      encoder_out_dict["sentemb"] = encoder_out_dict[
          "sentemb"
      ].index_select(0, new_order)
      encoder_out_dict["encoder_out"] = tuple(
          eo.index_select(1, new_order)
          for eo in encoder_out_dict["encoder_out"]
      )
      if encoder_out_dict["encoder_padding_mask"] is not None:
          encoder_out_dict["encoder_padding_mask"] = encoder_out_dict[
              "encoder_padding_mask"
          ].index_select(1, new_order)
      return encoder_out_dict
  
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 LSTMEncoder obj's underlying member method code with example usage: obj.reorder_encoder_out(encoder_out_dict, new_order) and returns: encoder_out_dict