docstr: __init__.
  :param inplanes: int, number of channels in the input sequence.
  :param planes: int,  number of channels produced by the convolution.
  :param stride: int, size of the convolving kernel.
  :param downsample: boolean, if True, the temporal resolution is downsampled.
  :param relu_type: str, type of activation function.
docstr_tok: ["__init__",".",":","param","inplanes",":","int",",","number","of","channels","in","the","input","sequence",".",":","param","planes",":","int",",","number","of","channels","produced","by","the","convolution",".",":","param","stride",":","int",",","size","of","the","convolving","kernel",".",":","param","downsample",":","boolean",",","if","True",",","the","temporal","resolution","is","downsampled",".",":","param","relu_type",":","str",",","type","of","activation","function","."]
code: def __init__(
      self,
      inplanes,
      planes,
      stride=1,
      downsample=None,
      relu_type="swish",
  ):
      """__init__.
      :param inplanes: int, number of channels in the input sequence.
      :param planes: int,  number of channels produced by the convolution.
      :param stride: int, size of the convolving kernel.
      :param downsample: boolean, if True, the temporal resolution is downsampled.
      :param relu_type: str, type of activation function.
      """
      super(BasicBlock, self).__init__()
  
      assert relu_type in ["relu", "prelu", "swish"]
  
      self.conv1 = conv3x3(inplanes, planes, stride)
      self.bn1 = nn.BatchNorm2d(planes)
  
      if relu_type == "relu":
          self.relu1 = nn.ReLU(inplace=True)
          self.relu2 = nn.ReLU(inplace=True)
      elif relu_type == "prelu":
          self.relu1 = nn.PReLU(num_parameters=planes)
          self.relu2 = nn.PReLU(num_parameters=planes)
      elif relu_type == "swish":
          self.relu1 = nn.SiLU(inplace=True)
          self.relu2 = nn.SiLU(inplace=True)
      else:
          raise NotImplementedError
      # --------
  
      self.conv2 = conv3x3(planes, planes)
      self.bn2 = nn.BatchNorm2d(planes)
  
      self.downsample = downsample
      self.stride = stride
  
file_path: audio/examples/avsr/models/resnet.py
imports: import torch.nn
label_desc: Use image node_id 1 to create a new BasicBlock object from inherited base classes: nn with example: obj = BasicBlock(inplanes, planes, stride, downsample, relu_type)