class_docstr: Transformer-based Speech translation model from ESPNet-ST
  https://arxiv.org/abs/2004.10234
class_docstr_tok: ["Transformer-based","Speech","translation","model","from","ESPNet-ST","https",":","\/\/arxiv.org\/abs\/2004.10234"]
code: def build_encoder(cls, args):
      encoder = ConvTransformerEncoder(args)
      if (
          getattr(args, "load_pretrained_encoder_from", None)
          is not None
      ):
          encoder = (
              checkpoint_utils.load_pretrained_component_from_model(
                  component=encoder,
                  checkpoint=args.load_pretrained_encoder_from,
              )
          )
      return encoder
  
imports: import logging
  import math
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from fairseq import checkpoint_utils, utils
  from fairseq.data.data_utils import lengths_to_padding_mask
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.models.speech_to_text.modules.convolution import infer_conv_output_dim
  from fairseq.models.transformer import Embedding, TransformerDecoder
  from fairseq.modules import LayerNorm, PositionalEmbedding, TransformerEncoderLayer
label_desc: Use image node_id 3 for calling the ConvTransformerModel obj's underlying member method code with example usage: obj.build_encoder(cls, args) and returns: encoder