class_docstr: An implementation of the speaker embedding model in a paper.
  "ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in
  TDNN Based Speaker Verification" (https://arxiv.org/abs/2005.07143).
  
  Arguments
  ---------
  device : str
      Device used, e.g., "cpu" or "cuda".
  activation : torch class
      A class for constructing the activation layers.
  channels : list of ints
      Output channels for TDNN/SERes2Net layer.
  kernel_sizes : list of ints
      List of kernel sizes for each layer.
  dilations : list of ints
      List of dilations for kernels in each layer.
  lin_neurons : int
      Number of neurons in linear layers.
  groups : list of ints
      List of groups for kernels in each layer.
  
  Example
  -------
  >>> input_feats = torch.rand([5, 120, 80])
  >>> compute_embedding = ECAPA_TDNN(80, lin_neurons=192)
  >>> outputs = compute_embedding(input_feats)
  >>> outputs.shape
  torch.Size([5, 1, 192])
class_docstr_tok: ["An","implementation","of","the","speaker","embedding","model","in","a","paper",".","``","ECAPA-TDNN",":","Emphasized","Channel","Attention",",","Propagation","and","Aggregation","in","TDNN","Based","Speaker","Verification","''","(","https",":","\/\/arxiv.org\/abs\/2005.07143",")",".","Arguments","--","--","--","--","-","device",":","str","Device","used",",","e.g.",",","``","cpu","''","or","``","cuda","''",".","activation",":","torch","class","A","class","for","constructing","the","activation","layers",".","channels",":","list","of","ints","Output","channels","for","TDNN\/SERes2Net","layer",".","kernel_sizes",":","list","of","ints","List","of","kernel","sizes","for","each","layer",".","dilations",":","list","of","ints","List","of","dilations","for","kernels","in","each","layer",".","lin_neurons",":","int","Number","of","neurons","in","linear","layers",".","groups",":","list","of","ints","List","of","groups","for","kernels","in","each","layer",".","Example","--","--","--","-",">",">",">","input_feats","=","torch.rand","(","[","5",",","120",",","80","]",")",">",">",">","compute_embedding","=","ECAPA_TDNN","(","80",",","lin_neurons=192",")",">",">",">","outputs","=","compute_embedding","(","input_feats",")",">",">",">","outputs.shape","torch.Size","(","[","5",",","1",",","192","]",")"]
code: def __init__(
      self,
      input_size,
      device="cpu",
      lin_neurons=192,
      activation=torch.nn.ReLU,
      channels=[512, 512, 512, 512, 1536],
      kernel_sizes=[5, 3, 3, 3, 1],
      dilations=[1, 2, 3, 4, 1],
      attention_channels=128,
      res2net_scale=8,
      se_channels=128,
      global_context=True,
      groups=[1, 1, 1, 1, 1],
  ):
      super().__init__()
      assert len(channels) == len(kernel_sizes)
      assert len(channels) == len(dilations)
      self.channels = channels
      self.blocks = nn.ModuleList()
  
      # The initial TDNN layer
      self.blocks.append(
          TDNNBlock(
              input_size,
              channels[0],
              kernel_sizes[0],
              dilations[0],
              activation,
              groups[0],
          )
      )
  
      # SE-Res2Net layers
      for i in range(1, len(channels) - 1):
          self.blocks.append(
              SERes2NetBlock(
                  channels[i - 1],
                  channels[i],
                  res2net_scale=res2net_scale,
                  se_channels=se_channels,
                  kernel_size=kernel_sizes[i],
                  dilation=dilations[i],
                  activation=activation,
                  groups=groups[i],
              )
          )
  
      # Multi-layer feature aggregation
      self.mfa = TDNNBlock(
          channels[-2] * (len(channels) - 2),
          channels[-1],
          kernel_sizes[-1],
          dilations[-1],
          activation,
          groups=groups[-1],
      )
  
      # Attentive Statistical Pooling
      self.asp = AttentiveStatisticsPooling(
          channels[-1],
          attention_channels=attention_channels,
          global_context=global_context,
      )
      self.asp_bn = BatchNorm1d(input_size=channels[-1] * 2)
  
      # Final linear transformation
      self.fc = Conv1d(
          in_channels=channels[-1] * 2,
          out_channels=lin_neurons,
          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 ECAPA_TDNN object from inherited base classes: torch.nn with example: obj = ECAPA_TDNN(input_size, device, lin_neurons, activation, channels, kernel_sizes, dilations, attention_channels, res2net_scale, se_channels, global_context, groups)