class_docstr: This class drops slices of the input spectrogram.
  
  Using `SpectrogramDrop` as an augmentation strategy helps a models learn to rely
  on all parts of the signal, since it can't expect a given part to be
  present.
  
  Reference:
      https://arxiv.org/abs/1904.08779
  
  Arguments
  ---------
  drop_length_low : int
      The low end of lengths for which to drop the
      spectrogram, in samples.
  drop_length_high : int
      The high end of lengths for which to drop the
      signal, in samples.
  drop_count_low : int
      The low end of number of times that the signal
      can be dropped.
  drop_count_high : int
      The high end of number of times that the signal
      can be dropped.
  replace: str
      - 'zeros': Masked values are replaced with zeros.
      - 'mean': Masked values are replaced with the mean value of the spectrogram.
      - 'rand': Masked values are replaced with random numbers ranging between
                the maximum and minimum values of the spectrogram.
      - 'cutcat': Masked values are replaced with chunks from other signals in the batch.
      - 'swap': Masked values are replaced with other chunks from the same sentence.
      - 'random_selection': A random selection among the approaches above.
  dim : int
      Corresponding dimension to mask. If dim=1, we apply time masking.
      If dim=2, we apply frequency masking.
  
  Example
  -------
  >>> # time-masking
  >>> drop = SpectrogramDrop(dim=1)
  >>> spectrogram = torch.rand(4, 150, 40)
  >>> print(spectrogram.shape)
  torch.Size([4, 150, 40])
  >>> out = drop(spectrogram)
  >>> print(out.shape)
  torch.Size([4, 150, 40])
  >>> # frequency-masking
  >>> drop = SpectrogramDrop(dim=2)
  >>> spectrogram = torch.rand(4, 150, 40)
  >>> print(spectrogram.shape)
  torch.Size([4, 150, 40])
  >>> out = drop(spectrogram)
  >>> print(out.shape)
  torch.Size([4, 150, 40])
code: def __init__(
      self,
      drop_length_low=5,
      drop_length_high=15,
      drop_count_low=1,
      drop_count_high=3,
      replace="zeros",
      dim=1,
  ):
      super().__init__()
      self.drop_length_low = drop_length_low
      self.drop_length_high = drop_length_high
      self.drop_count_low = drop_count_low
      self.drop_count_high = drop_count_high
      self.replace = replace
      self.dim = dim
  
      # Validate low < high
      if drop_length_low > drop_length_high:
          raise ValueError("Low limit must not be more than high limit")
      if drop_count_low > drop_count_high:
          raise ValueError("Low limit must not be more than high limit")
  
      self.replace_opts = [
          "zeros",
          "mean",
          "rand",
          "cutcat",
          "swap",
          "random_selection",
      ]
      if self.replace not in self.replace_opts:
          raise ValueError(
              f"Invalid 'replace' option. Select one of {', '.join(self.replace_opts)}"
          )
  
file_path: speechbrain/speechbrain/augment/freq_domain.py
imports: import torch
  import random
label_desc: Use image node_id 1 to create a new SpectrogramDrop object from inherited base classes: torch.nn with example: obj = SpectrogramDrop(drop_length_low, drop_length_high, drop_count_low, drop_count_high, replace, dim)