class_docstr: An implementation of building block in ECAPA-TDNN, i.e.,
  TDNN-Res2Net-TDNN-SEBlock.
  
  Arguments
  ----------
  out_channels: int
      The number of output channels.
  res2net_scale: int
      The scale of the Res2Net block.
  kernel_size: int
      The kernel size of the TDNN blocks.
  dilation: int
      The dilation of the Res2Net block.
  activation : torch class
      A class for constructing the activation layers.
  groups: int
  Number of blocked connections from input channels to output channels.
  
  Example
  -------
  >>> x = torch.rand(8, 120, 64).transpose(1, 2)
  >>> conv = SERes2NetBlock(64, 64, res2net_scale=4)
  >>> out = conv(x).transpose(1, 2)
  >>> out.shape
  torch.Size([8, 120, 64])
class_docstr_tok: ["An","implementation","of","building","block","in","ECAPA-TDNN",",","i.e.",",","TDNN-Res2Net-TDNN-SEBlock",".","Arguments","--","--","--","--","--","out_channels",":","int","The","number","of","output","channels",".","res2net_scale",":","int","The","scale","of","the","Res2Net","block",".","kernel_size",":","int","The","kernel","size","of","the","TDNN","blocks",".","dilation",":","int","The","dilation","of","the","Res2Net","block",".","activation",":","torch","class","A","class","for","constructing","the","activation","layers",".","groups",":","int","Number","of","blocked","connections","from","input","channels","to","output","channels",".","Example","--","--","--","-",">",">",">","x","=","torch.rand","(","8",",","120",",","64",")",".transpose","(","1",",","2",")",">",">",">","conv","=","SERes2NetBlock","(","64",",","64",",","res2net_scale=4",")",">",">",">","out","=","conv","(","x",")",".transpose","(","1",",","2",")",">",">",">","out.shape","torch.Size","(","[","8",",","120",",","64","]",")"]
code: def __init__(
      self,
      in_channels,
      out_channels,
      res2net_scale=8,
      se_channels=128,
      kernel_size=1,
      dilation=1,
      activation=torch.nn.ReLU,
      groups=1,
  ):
      super().__init__()
      self.out_channels = out_channels
      self.tdnn1 = TDNNBlock(
          in_channels,
          out_channels,
          kernel_size=1,
          dilation=1,
          activation=activation,
          groups=groups,
      )
      self.res2net_block = Res2NetBlock(
          out_channels,
          out_channels,
          res2net_scale,
          kernel_size,
          dilation,
      )
      self.tdnn2 = TDNNBlock(
          out_channels,
          out_channels,
          kernel_size=1,
          dilation=1,
          activation=activation,
          groups=groups,
      )
      self.se_block = SEBlock(out_channels, se_channels, out_channels)
  
      self.shortcut = None
      if in_channels != out_channels:
          self.shortcut = Conv1d(
              in_channels=in_channels,
              out_channels=out_channels,
              kernel_size=1,
          )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from speechbrain.dataio.dataio import length_to_mask
  from speechbrain.nnet.CNN import Conv1d
  from speechbrain.nnet.normalization import BatchNorm1d
  from speechbrain.nnet.linear import Linear
label_desc: Use image node_id 1 to create a new SERes2NetBlock object from inherited base classes: nn with example: obj = SERes2NetBlock(in_channels, out_channels, res2net_scale, se_channels, kernel_size, dilation, activation, groups)