class_docstr: Encoder module following Transformer encoder paradigm 
  as described in Vaswani et al. (https://arxiv.org/abs/1706.03762). Used for Wav2Vec
  style encoding of context vectors as described by in Baeski et al (https://arxiv.org/abs/2006.11477).
  Takes convolutional encodings of all time steps and adds to features before applying series
  of self-attention layers. 
  
  Example configs may be found at: https://github.com/NVIDIA/NeMo/tree/main/examples/asr/conf/wav2vec
  
  Args:
          layer_drop: Floating point value specifying proportion of module for layer dropout (See Fan et al. https://arxiv.org/pdf/1909.11556.pdf).
                  If non-zero, each layer will draw from uniform probability to determine if applied in current forward call.
                  Occurs only during training step
          pos_embed: Config specifying parameters for contextual embedding convolutions. Module configures convolutional padding
                  to maintain number of time steps
                  Must contain following:
                          embedding_dim: Depth/number of channels of each time step from feature encoding 
                          conv_pos: Kernel size for convolution
                          conv_pos_groups: Number of groups for convolution
          transformer: Config for transformer encoder. Uses self-attention layers found in: nemo.collections.nlp.modules.common.transformer
                  Must contain followign:
                          num_layers: Number of attention layers 
                          hidden_size: Expected input depth (embedding size between model layers)
                          inner_size: Depth of embeddings within feed-forward sections of encoder layers
                          num_attention_heads: Number of attention heads
                          attn_score_dropout: Probability of dropout applied to attention scores
                          attn_layer_dropout: Probability of dropout applied to the output of the attention layers (prior to normalization)
                          ffn_dropout: Probability of dropout applied to feed-forward modules
                          hidden_act: Activation function for hidden layers
class_docstr_tok: ["Encoder","module","following","Transformer","encoder","paradigm","as","described","in","Vaswani","et","al",".","(","https",":","\/\/arxiv.org\/abs\/1706.03762",")",".","Used","for","Wav2Vec","style","encoding","of","context","vectors","as","described","by","in","Baeski","et","al","(","https",":","\/\/arxiv.org\/abs\/2006.11477",")",".","Takes","convolutional","encodings","of","all","time","steps","and","adds","to","features","before","applying","series","of","self-attention","layers",".","Example","configs","may","be","found","at",":","https",":","\/\/github.com\/NVIDIA\/NeMo\/tree\/main\/examples\/asr\/conf\/wav2vec","Args",":","layer_drop",":","Floating","point","value","specifying","proportion","of","module","for","layer","dropout","(","See","Fan","et","al",".","https",":","\/\/arxiv.org\/pdf\/1909.11556.pdf",")",".","If","non-zero",",","each","layer","will","draw","from","uniform","probability","to","determine","if","applied","in","current","forward","call",".","Occurs","only","during","training","step","pos_embed",":","Config","specifying","parameters","for","contextual","embedding","convolutions",".","Module","configures","convolutional","padding","to","maintain","number","of","time","steps","Must","contain","following",":","embedding_dim",":","Depth\/number","of","channels","of","each","time","step","from","feature","encoding","conv_pos",":","Kernel","size","for","convolution","conv_pos_groups",":","Number","of","groups","for","convolution","transformer",":","Config","for","transformer","encoder",".","Uses","self-attention","layers","found","in",":","nemo.collections.nlp.modules.common.transformer","Must","contain","followign",":","num_layers",":","Number","of","attention","layers","hidden_size",":","Expected","input","depth","(","embedding","size","between","model","layers",")","inner_size",":","Depth","of","embeddings","within","feed-forward","sections","of","encoder","layers","num_attention_heads",":","Number","of","attention","heads","attn_score_dropout",":","Probability","of","dropout","applied","to","attention","scores","attn_layer_dropout",":","Probability","of","dropout","applied","to","the","output","of","the","attention","layers","(","prior","to","normalization",")","ffn_dropout",":","Probability","of","dropout","applied","to","feed-forward","modules","hidden_act",":","Activation","function","for","hidden","layers"]
docstr: Returns definitions of module output ports. 
  We're using SpectrogramType for now to keep things Nemo safe
  processed_signal:
      0: AxisType(BatchTag)
      1: AxisType(ChannelTag)
      2: AxisType(ProcessedTimeTag)
  processed_length:
      0: AxisType(BatchTag)
docstr_tok: ["Returns","definitions","of","module","output","ports",".","We","'re","using","SpectrogramType","for","now","to","keep","things","Nemo","safe","processed_signal",":","0",":","AxisType","(","BatchTag",")","1",":","AxisType","(","ChannelTag",")","2",":","AxisType","(","ProcessedTimeTag",")","processed_length",":","0",":","AxisType","(","BatchTag",")"]
code: def output_types(self):
      """Returns definitions of module output ports.
      We're using SpectrogramType for now to keep things Nemo safe
      processed_signal:
          0: AxisType(BatchTag)
          1: AxisType(ChannelTag)
          2: AxisType(ProcessedTimeTag)
      processed_length:
          0: AxisType(BatchTag)
      """
      return {
          "processed_signal": NeuralType(
              ("B", "C", "T"), AcousticEncodedRepresentation()
          ),
          "processed_length": NeuralType(tuple("B"), LengthsType()),
      }
  
imports: import math
  import random
  from typing import Dict, List, Tuple
  import torch
  from omegaconf import DictConfig
  from omegaconf.dictconfig import DictConfig
  from torch import nn
  from torch.nn import functional
  from nemo.collections.common.parts import form_attention_mask, transformer_weights_init
  from nemo.collections.nlp.modules.common.transformer import TransformerEncoder
  from nemo.core.classes.module import NeuralModule
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LengthsType, NeuralType, SpectrogramType
label_desc: Use image node_id 3 for calling the Wav2VecTransformerEncoder obj's underlying member method code with example usage: obj.output_types() and returns: dict