class_docstr: An implementation of ResNet
  
  Arguments
  ---------
  device : str
      Device used, e.g., "cpu" or "cuda".
  activation : torch class
      A class for constructing the activation layers.
  channels : list of ints
      List of number of channels used per stage.
  block_sizes : list of ints
      List of number of groups created per stage.
  strides : list of ints
      List of stride per stage.
  lin_neurons : int
      Number of neurons in linear layers.
  
  Example
  -------
  >>> input_feats = torch.rand([2, 400, 80])
  >>> compute_embedding = ResNet(lin_neurons=256)
  >>> outputs = compute_embedding(input_feats)
  >>> outputs.shape
  torch.Size([2, 256])
docstr: Returns the embedding vector.
  
  Arguments
  ---------
  x : torch.Tensor
      Tensor of shape (batch, time, channel).
docstr_tok: ["Returns","the","embedding","vector",".","Arguments","--","--","--","--","-","x",":","torch.Tensor","Tensor","of","shape","(","batch",",","time",",","channel",")","."]
code: def forward(self, x, lengths=None):
      """Returns the embedding vector.
  
      Arguments
      ---------
      x : torch.Tensor
          Tensor of shape (batch, time, channel).
      """
      x = x.unsqueeze(1)
  
      x = self.conv1(x)
      x = self.bn1(x)
      x = self.activation1(x)
  
      x = self.layer1(x)
      x = self.layer2(x)
      x = self.layer3(x)
      x = self.layer4(x)
  
      x = x.transpose(2, 3)
      x = x.flatten(1, 2)
  
      w = self.attention(x)
  
      mu = torch.sum(x * w, dim=2)
      sg = torch.sqrt(
          (torch.sum((x**2) * w, dim=2) - mu**2).clamp(min=1e-5)
      )
      x = torch.cat([mu, sg], dim=1)
      x = self.norm_stats(x)
  
      x = self.fc_embed(x)
      x = self.norm_embed(x)
  
      return x
  
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 4 for calling the ResNet obj's underlying member method code with example usage: obj.forward(x, lengths) and returns: x