class_docstr: This class implements 1D Gabor Convolutions from
  
  Neil Zeghidour, Olivier Teboul, F{'e}lix de Chaumont Quitry & Marco Tagliasacchi, "LEAF: A LEARNABLE FRONTEND
  FOR AUDIO CLASSIFICATION", in Proc. of ICLR 2021 (https://arxiv.org/abs/2101.08596)
  
  Arguments
  ---------
  out_channels : int
      It is the number of output channels.
  kernel_size: int
      Kernel size of the convolutional filters.
  stride : int
      Stride factor of the convolutional filters. When the stride factor > 1,
      a decimation in time is performed.
  padding : str
      (same, valid). If "valid", no padding is performed.
      If "same" and stride is 1, output shape is the same as the input shape.
  padding_mode : str
      This flag specifies the type of padding. See torch.nn documentation
      for more information.
  sample_rate : int,
      Sampling rate of the input signals. It is only used for sinc_conv.
  min_freq : float
      Lowest possible frequency (in Hz) for a filter
  max_freq : float
      Highest possible frequency (in Hz) for a filter
  n_fft: int
      number of FFT bins for initialization
  normalize_energy: bool
      whether to normalize energy at initialization. Default is False
  bias : bool
      If True, the additive bias b is adopted.
  sort_filters: bool
      whether to sort filters by center frequencies. Default is False
  use_legacy_complex: bool
      If False, torch.complex64 data type is used for gabor impulse responses
      If True, computation is performed on two real-valued tensors
  skip_transpose: bool
      If False, uses batch x time x channel convention of speechbrain.
      If True, uses batch x channel x time convention.
  
  Example
  -------
  >>> inp_tensor = torch.rand([10, 8000])
  >>> # 401 corresponds to a window of 25 ms at 16000 kHz
  >>> gabor_conv = GaborConv1d(
  ...     40, kernel_size=401, stride=1, in_channels=1
  ... )
  >>> #
  >>> out_tensor = gabor_conv(inp_tensor)
  >>> out_tensor.shape
  torch.Size([10, 8000, 40])
code: def __init__(
      self,
      out_channels,
      kernel_size,
      stride,
      input_shape=None,
      in_channels=None,
      padding="same",
      padding_mode="constant",
      sample_rate=16000,
      min_freq=60.0,
      max_freq=None,
      n_fft=512,
      normalize_energy=False,
      bias=False,
      sort_filters=False,
      use_legacy_complex=False,
      skip_transpose=False,
  ):
      super(GaborConv1d, self).__init__()
      self.filters = out_channels // 2
      self.kernel_size = kernel_size
      self.stride = stride
      self.padding = padding
      self.padding_mode = padding_mode
      self.sort_filters = sort_filters
      self.sample_rate = sample_rate
      self.min_freq = min_freq
      if max_freq is None:
          max_freq = sample_rate / 2
      self.max_freq = max_freq
      self.n_fft = n_fft
      self.normalize_energy = normalize_energy
      self.use_legacy_complex = use_legacy_complex
      self.skip_transpose = skip_transpose
  
      if input_shape is None and in_channels is None:
          raise ValueError(
              "Must provide one of input_shape or in_channels"
          )
  
      if in_channels is None:
          in_channels = self._check_input_shape(input_shape)
  
      self.kernel = nn.Parameter(self._initialize_kernel())
      if bias:
          self.bias = torch.nn.Parameter(
              torch.ones(
                  self.filters * 2,
              )
          )
      else:
          self.bias = None
  
imports: import math
  import torch
  import logging
  import numpy
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from typing import Tuple
  from speechbrain.processing.signal_processing import gabor_impulse_response, gabor_impulse_response_legacy_complex
label_desc: Use image node_id 1 to create a new GaborConv1d object from inherited base classes: nn with example: obj = GaborConv1d(out_channels, kernel_size, stride, input_shape, in_channels, padding, padding_mode, sample_rate, min_freq, max_freq, n_fft, normalize_energy, bias, sort_filters, use_legacy_complex, skip_transpose)