class_docstr: Builds modules of a wav2vec 2.0 encoder as described in
  :cite:t:`https://doi.org/10.48550/arxiv.2006.11477`.
  
  To tweak the architecture, you can derive from this class and override the
  corresponding methods.
docstr: Build a position encoder.
docstr_tok: ["Build","a","position","encoder","."]
code: def build_position_encoder(self) -> Optional[PositionEncoder]:
      """Build a position encoder."""
      if self.config.pos_encoder_type != "conv":
          return None
  
      if self.config.pos_encoder_depth == 1:
          return Wav2Vec2PositionEncoder(
              self.config.model_dim,
              self.config.pos_conv_kernel_size,
              self.config.num_pos_conv_groups,
              device=self.device,
              dtype=self.dtype,
          )
      else:
          return Wav2Vec2StackedPositionEncoder(
              self.config.model_dim,
              self.config.pos_conv_kernel_size,
              self.config.num_pos_conv_groups,
              self.config.pos_encoder_depth,
              device=self.device,
              dtype=self.dtype,
          )
  
imports: from dataclasses import dataclass
  from typing import List, Optional, Tuple
  from torch.nn import GELU, SiLU
  from fairseq2.models.conformer import ConformerBlock, ConformerConvolution
  from fairseq2.models.feature_extractor import SequenceFeatureExtractor
  from fairseq2.models.utils import ArchitectureRegistry
  from fairseq2.models.wav2vec2.feature_extractor import Wav2Vec2FbankFeatureExtractor, Wav2Vec2FeatureExtractor
  from fairseq2.models.wav2vec2.frontend import Wav2Vec2Frontend
  from fairseq2.models.wav2vec2.masker import Wav2Vec2Masker
  from fairseq2.models.wav2vec2.model import Wav2Vec2Model
  from fairseq2.models.wav2vec2.position_encoder import Wav2Vec2PositionEncoder, Wav2Vec2StackedPositionEncoder
  from fairseq2.models.wav2vec2.vector_quantizer import GumbelVectorQuantizer, VectorQuantizer
  from fairseq2.nn.position_encoder import PositionEncoder, RotaryEncoder
  from fairseq2.nn.transformer import SDPA, FeedForwardNetwork, MultiheadAttention, RelativePositionalEncoding, RelativePositionSDPA, StandardFeedForwardNetwork, StandardMultiheadAttention, StandardTransformerEncoder, StandardTransformerEncoderLayer, TransformerEncoder, TransformerEncoderLayer, TransformerNormOrder, create_default_sdpa
  from fairseq2.typing import DataType, Device
label_desc: Use image node_id 4 for calling the Wav2Vec2EncoderBuilder obj's underlying member method code with example usage: obj.build_position_encoder() and returns: None, Wav2Vec2PositionEncoder, Wav2Vec2StackedPositionEncoder