class_docstr: An implementation of squeeze-and-excitation block.
  
  Arguments
  ---------
  in_channels : int
      The number of input channels.
  se_channels : int
      The number of output channels after squeeze.
  out_channels : int
      The number of output channels.
  
  Example
  -------
  >>> inp_tensor = torch.rand([8, 120, 64]).transpose(1, 2)
  >>> se_layer = SEBlock(64, 16, 64)
  >>> lengths = torch.rand((8,))
  >>> out_tensor = se_layer(inp_tensor, lengths).transpose(1, 2)
  >>> out_tensor.shape
  torch.Size([8, 120, 64])
class_docstr_tok: ["An","implementation","of","squeeze-and-excitation","block",".","Arguments","--","--","--","--","-","in_channels",":","int","The","number","of","input","channels",".","se_channels",":","int","The","number","of","output","channels","after","squeeze",".","out_channels",":","int","The","number","of","output","channels",".","Example","--","--","--","-",">",">",">","inp_tensor","=","torch.rand","(","[","8",",","120",",","64","]",")",".transpose","(","1",",","2",")",">",">",">","se_layer","=","SEBlock","(","64",",","16",",","64",")",">",">",">","lengths","=","torch.rand","(","(","8",",",")",")",">",">",">","out_tensor","=","se_layer","(","inp_tensor",",","lengths",")",".transpose","(","1",",","2",")",">",">",">","out_tensor.shape","torch.Size","(","[","8",",","120",",","64","]",")"]
code: def __init__(self, in_channels, se_channels, out_channels):
      super(SEBlock, self).__init__()
  
      self.conv1 = Conv1d(
          in_channels=in_channels,
          out_channels=se_channels,
          kernel_size=1,
      )
      self.relu = torch.nn.ReLU(inplace=True)
      self.conv2 = Conv1d(
          in_channels=se_channels,
          out_channels=out_channels,
          kernel_size=1,
      )
      self.sigmoid = torch.nn.Sigmoid()
  
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 SEBlock object from inherited base classes: nn with example: obj = SEBlock(in_channels, se_channels, out_channels)