docstr: __init__.
  :param block: torch.nn.Module, class of blocks.
  :param layers: List, customised layers in each block.
  :param relu_type: str, type of activation function.
  :param a_upsample_ratio: int, The ratio related to the             temporal resolution of output features of the frontend.             a_upsample_ratio=1 produce features with a fps of 25.
docstr_tok: ["__init__",".",":","param","block",":","torch.nn.Module",",","class","of","blocks",".",":","param","layers",":","List",",","customised","layers","in","each","block",".",":","param","relu_type",":","str",",","type","of","activation","function",".",":","param","a_upsample_ratio",":","int",",","The","ratio","related","to","the","temporal","resolution","of","output","features","of","the","frontend",".","a_upsample_ratio=1","produce","features","with","a","fps","of","25","."]
code: def __init__(
      self,
      block,
      layers,
      relu_type="swish",
      a_upsample_ratio=1,
  ):
      """__init__.
          :param block: torch.nn.Module, class of blocks.
          :param layers: List, customised layers in each block.
          :param relu_type: str, type of activation function.
          :param a_upsample_ratio: int, The ratio related to the \
              temporal resolution of output features of the frontend. \
              a_upsample_ratio=1 produce features with a fps of 25.
          """
      super(ResNet1D, self).__init__()
      self.inplanes = 64
      self.relu_type = relu_type
      self.downsample_block = downsample_basic_block
      self.a_upsample_ratio = a_upsample_ratio
  
      self.conv1 = nn.Conv1d(
          in_channels=1,
          out_channels=self.inplanes,
          kernel_size=80,
          stride=4,
          padding=38,
          bias=False,
      )
      self.bn1 = nn.BatchNorm1d(self.inplanes)
  
      if relu_type == "relu":
          self.relu = nn.ReLU(inplace=True)
      elif relu_type == "prelu":
          self.relu = nn.PReLU(num_parameters=self.inplanes)
      elif relu_type == "swish":
          self.relu = nn.SiLU(inplace=True)
  
      self.layer1 = self._make_layer(block, 64, layers[0])
      self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
      self.layer3 = self._make_layer(block, 256, layers[2], stride=2)
      self.layer4 = self._make_layer(block, 512, layers[3], stride=2)
      self.avgpool = nn.AvgPool1d(
          kernel_size=20 // self.a_upsample_ratio,
          stride=20 // self.a_upsample_ratio,
      )
  
file_path: audio/examples/avsr/models/resnet1d.py
imports: import torch.nn
label_desc: Use image node_id 1 to create a new ResNet1D object from inherited base classes: nn with example: obj = ResNet1D(block, layers, relu_type, a_upsample_ratio)