class_docstr: Masks extracted features as described in Section 3.1 of
  :cite:t:`https://doi.org/10.48550/arxiv.2006.11477`.
class_docstr_tok: ["Masks","extracted","features","as","described","in","Section","3.1","of",":","cite",":","t",":","`","https",":","\/\/doi.org\/10.48550\/arxiv.2006.11477","`","."]
docstr: :param model_dim:
      The dimensionality of the model.
  :param temporal_span_len:
      The length of each temporal mask span that is applied over time
      steps.
  :param max_temporal_mask_prob:
      The maximum probability of masking a time step. Note that, due to
      mask span overlap, the effective probability might be smaller.
  :param spatial_span_len:
      The length of each spatial mask span that is applied over features.
  :param max_spatial_mask_prob:
      The maximum probability of masking a feature. Note that, due to mask
      span overlap, the effective probability might be smaller.
docstr_tok: [":","param","model_dim",":","The","dimensionality","of","the","model",".",":","param","temporal_span_len",":","The","length","of","each","temporal","mask","span","that","is","applied","over","time","steps",".",":","param","max_temporal_mask_prob",":","The","maximum","probability","of","masking","a","time","step",".","Note","that",",","due","to","mask","span","overlap",",","the","effective","probability","might","be","smaller",".",":","param","spatial_span_len",":","The","length","of","each","spatial","mask","span","that","is","applied","over","features",".",":","param","max_spatial_mask_prob",":","The","maximum","probability","of","masking","a","feature",".","Note","that",",","due","to","mask","span","overlap",",","the","effective","probability","might","be","smaller","."]
code: def __init__(
      self,
      model_dim: int,
      temporal_span_len: int = 10,
      max_temporal_mask_prob: float = 0.65,
      spatial_span_len: int = 10,
      max_spatial_mask_prob: float = 0.0,
      *,
      device: Optional[Device] = None,
      dtype: Optional[DataType] = None,
  ) -> None:
      """
      :param model_dim:
          The dimensionality of the model.
      :param temporal_span_len:
          The length of each temporal mask span that is applied over time
          steps.
      :param max_temporal_mask_prob:
          The maximum probability of masking a time step. Note that, due to
          mask span overlap, the effective probability might be smaller.
      :param spatial_span_len:
          The length of each spatial mask span that is applied over features.
      :param max_spatial_mask_prob:
          The maximum probability of masking a feature. Note that, due to mask
          span overlap, the effective probability might be smaller.
      """
      super().__init__()
  
      if max_temporal_mask_prob == 0.0:
          raise ValueError(
              "`max_temporal_mask_prob` must be greater than 0."
          )
  
      self.temporal_span_len = temporal_span_len
      self.max_temporal_mask_prob = max_temporal_mask_prob
  
      self.temporal_mask_embed = Parameter(
          torch.empty((model_dim,), device=device, dtype=dtype)
      )
  
      self.spatial_span_len = spatial_span_len
      self.max_spatial_mask_prob = max_spatial_mask_prob
  
      self.reset_parameters()
  
file_path: fairseq2/src/fairseq2/models/wav2vec2/masker.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import Module, Parameter
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.nn.utils.mask import compute_row_mask
  from fairseq2.typing import DataType, Device
label_desc: Use image node_id 1 to create a new Wav2Vec2Masker object from inherited base classes: Module with example: obj = Wav2Vec2Masker(model_dim, temporal_span_len, max_temporal_mask_prob, spatial_span_len, max_spatial_mask_prob)