code: def specaug(
      spec,
      W=5,
      F=30,
      T=40,
      num_freq_masks=2,
      num_time_masks=2,
      replace_with_zero=False,
  ):
      """SpecAugment
  
      Reference:
          SpecAugment: A Simple Data Augmentation Method for Automatic Speech Recognition
          (https://arxiv.org/pdf/1904.08779.pdf)
  
      This implementation modified from https://github.com/zcaceres/spec_augment
  
      :param torch.Tensor spec: input tensor with the shape (T, dim)
      :param int W: time warp parameter
      :param int F: maximum width of each freq mask
      :param int T: maximum width of each time mask
      :param int num_freq_masks: number of frequency masks
      :param int num_time_masks: number of time masks
      :param bool replace_with_zero: if True, masked parts will be filled with 0,
          if False, filled with mean
      """
      return time_mask(
          freq_mask(
              time_warp(spec, W=W),
              F=F,
              num_masks=num_freq_masks,
              replace_with_zero=replace_with_zero,
          ),
          T=T,
          num_masks=num_time_masks,
          replace_with_zero=replace_with_zero,
      )
  
file_path: espnet/espnet/utils/spec_augment.py
imports: import random
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: specaug(spec, W, F, T, num_freq_masks, num_time_masks, replace_with_zero) and returns: time_mask