class_docstr: Generate the masks for masked prediction.
  Args:
      encoder_embed_dim (int): The dimension of the transformer embedding output.
      mask_prob (float): Probability for each token to be chosen as start of the span to be masked.
          This will be multiplied by number of timesteps divided by length of mask span to mask
          approximately this percentage of all elements. However due to overlaps, the actual number
          will be smaller (unless no_overlap is True).
      mask_selection (str): How to choose the mask length.
          Options: [``static``, ``uniform``, ``normal``, ``poisson``].
      mask_other (float): Secondary mask argument (used for more complex distributions).
      mask_length (int): The lengths of the mask.
      no_mask_overlap (bool):  Whether to allow masks to overlap.
      mask_min_space (int):  Minimum space between spans (if no overlap is enabled).
      mask_channel_prob (float): The probability of replacing a feature with 0.
      mask_channel_selection (str): How to choose the mask length for channel masking.
          Options: [``static``, ``uniform``, ``normal``, ``poisson``].
      mask_channel_other (float): Secondary mask argument for channel masking(used for more complex distributions).
      mask_channel_length (int): Minimum space between spans (if no overlap is enabled) for channel masking.
      no_mask_channel_overlap (bool):  Whether to allow channel masks to overlap.
      mask_channel_min_space (int): Minimum space between spans for channel masking(if no overlap is enabled).
class_docstr_tok: ["Generate","the","masks","for","masked","prediction",".","Args",":","encoder_embed_dim","(","int",")",":","The","dimension","of","the","transformer","embedding","output",".","mask_prob","(","float",")",":","Probability","for","each","token","to","be","chosen","as","start","of","the","span","to","be","masked",".","This","will","be","multiplied","by","number","of","timesteps","divided","by","length","of","mask","span","to","mask","approximately","this","percentage","of","all","elements",".","However","due","to","overlaps",",","the","actual","number","will","be","smaller","(","unless","no_overlap","is","True",")",".","mask_selection","(","str",")",":","How","to","choose","the","mask","length",".","Options",":","[","``","static","``",",","``","uniform","``",",","``","normal","``",",","``","poisson","``","]",".","mask_other","(","float",")",":","Secondary","mask","argument","(","used","for","more","complex","distributions",")",".","mask_length","(","int",")",":","The","lengths","of","the","mask",".","no_mask_overlap","(","bool",")",":","Whether","to","allow","masks","to","overlap",".","mask_min_space","(","int",")",":","Minimum","space","between","spans","(","if","no","overlap","is","enabled",")",".","mask_channel_prob","(","float",")",":","The","probability","of","replacing","a","feature","with","0.","mask_channel_selection","(","str",")",":","How","to","choose","the","mask","length","for","channel","masking",".","Options",":","[","``","static","``",",","``","uniform","``",",","``","normal","``",",","``","poisson","``","]",".","mask_channel_other","(","float",")",":","Secondary","mask","argument","for","channel","masking","(","used","for","more","complex","distributions",")",".","mask_channel_length","(","int",")",":","Minimum","space","between","spans","(","if","no","overlap","is","enabled",")","for","channel","masking",".","no_mask_channel_overlap","(","bool",")",":","Whether","to","allow","channel","masks","to","overlap",".","mask_channel_min_space","(","int",")",":","Minimum","space","between","spans","for","channel","masking","(","if","no","overlap","is","enabled",")","."]
code: def __init__(
      self,
      encoder_embed_dim: int,
      mask_prob: float,
      mask_selection: str,
      mask_other: float,
      mask_length: int,
      no_mask_overlap: bool,
      mask_min_space: int,
      mask_channel_prob: float,
      mask_channel_selection: str,
      mask_channel_other: float,
      mask_channel_length: int,
      no_mask_channel_overlap: bool,
      mask_channel_min_space: int,
  ):
      super().__init__()
      self.mask_prob = mask_prob
      self.mask_selection = mask_selection
      self.mask_other = mask_other
      self.mask_length = mask_length
      self.no_mask_overlap = no_mask_overlap
      self.mask_min_space = mask_min_space
      self.mask_channel_prob = mask_channel_prob
      self.mask_channel_selection = mask_channel_selection
      self.mask_channel_other = mask_channel_other
      self.mask_channel_length = mask_channel_length
      self.no_mask_channel_overlap = no_mask_channel_overlap
      self.mask_channel_min_space = mask_channel_min_space
      self.mask_embedding = Parameter(
          torch.FloatTensor(encoder_embed_dim)
      )
      torch.nn.init.uniform_(self.mask_embedding)
  
imports: import logging
  from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import Module, Parameter
  from .wavlm_attention import WavLMSelfAttention
label_desc: Use image node_id 1 to create a new MaskGenerator object from inherited base classes: Module with example: obj = MaskGenerator(encoder_embed_dim, mask_prob, mask_selection, mask_other, mask_length, no_mask_overlap, mask_min_space, mask_channel_prob, mask_channel_selection, mask_channel_other, mask_channel_length, no_mask_channel_overlap, mask_channel_min_space)