class_docstr: Convolutional encoder
class_docstr_tok: ["Convolutional","encoder"]
code: def reorder_encoder_out(self, encoder_out, new_order):
      encoder_out["encoder_out"] = tuple(
          eo.index_select(0, new_order)
          for eo in encoder_out["encoder_out"]
      )
  
      if encoder_out["encoder_padding_mask"] is not None:
          encoder_out["encoder_padding_mask"] = encoder_out[
              "encoder_padding_mask"
          ].index_select(0, new_order)
  
      if "pretrained" in encoder_out:
          encoder_out["pretrained"]["encoder_out"] = tuple(
              eo.index_select(0, new_order)
              for eo in encoder_out["pretrained"]["encoder_out"]
          )
  
      return encoder_out
  
imports: import logging
  import math
  import os
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import checkpoint_utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from fairseq.models import CompositeEncoder, FairseqDecoder, FairseqEncoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.modules import DownsampledMultiHeadAttention, FairseqDropout, GradMultiply, LayerNorm, LearnedPositionalEmbedding, LinearizedConvolution
label_desc: Use image node_id 3 for calling the FConvEncoder obj's underlying member method code with example usage: obj.reorder_encoder_out(encoder_out, new_order) and returns: encoder_out