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","]",")"]
docstr: Processes the input tensor x and returns an output tensor.
docstr_tok: ["Processes","the","input","tensor","x","and","returns","an","output","tensor","."]
code: def forward(self, x, lengths=None):
      """Processes the input tensor x and returns an output tensor."""
      residual = x
      if self.shortcut:
          residual = self.shortcut(x)
  
      x = self.tdnn1(x)
      x = self.res2net_block(x)
      x = self.tdnn2(x)
      x = self.se_block(x, lengths)
  
      return x + residual
  
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 2 for calling the SERes2NetBlock obj's underlying member method code with example usage: obj.forward(x, lengths) and returns: unknown