class_docstr: An implementation of ResNet Block.
  
  Arguments
  ----------
  in_channels : int
      Number of input channels.
  out_channels : int
      The number of output channels.
  stride : int
      Factor that reduce the spatial dimensionality
  downsample : torch function
      A function for downsample the identity of block when stride != 1
  activation : torch class
      A class for constructing the activation layers.
  
  Example
  -------
  >>> inp_tensor = torch.rand([1, 64, 80, 40])
  >>> layer = BasicBlock(64, 64, stride=1)
  >>> out_tensor = layer(inp_tensor)
  >>> out_tensor.shape
  torch.Size([1, 64, 80, 40])
code: def __init__(
      self,
      in_channels,
      out_channels,
      stride=1,
      downsample=None,
      activation=nn.ReLU,
  ):
      super(BasicBlock, self).__init__()
      self.activation = activation()
  
      self.bn1 = nn.BatchNorm2d(in_channels)
      self.conv1 = conv3x3(in_channels, out_channels, stride)
  
      self.bn2 = nn.BatchNorm2d(out_channels)
      self.conv2 = conv3x3(out_channels, out_channels)
  
      self.bn3 = nn.BatchNorm2d(out_channels)
      self.conv3 = conv1x1(out_channels, out_channels)
  
      self.downsample = downsample
      self.stride = stride
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from speechbrain.nnet.normalization import BatchNorm1d
  from speechbrain.nnet.linear import Linear
label_desc: Use image node_id 1 to create a new BasicBlock object from inherited base classes: nn with example: obj = BasicBlock(in_channels, out_channels, stride, downsample, activation)