class_docstr: ConformerConvolution module definition.
  
  Args:
      channels: The number of channels.
      kernel_size: Size of the convolving kernel.
      activation: Activation function.
      norm_args: Normalization module arguments.
      causal: Whether to use causal convolution (set to True if streaming).
class_docstr_tok: ["ConformerConvolution","module","definition",".","Args",":","channels",":","The","number","of","channels",".","kernel_size",":","Size","of","the","convolving","kernel",".","activation",":","Activation","function",".","norm_args",":","Normalization","module","arguments",".","causal",":","Whether","to","use","causal","convolution","(","set","to","True","if","streaming",")","."]
docstr: Compute convolution module.
  
  Args:
      x: ConformerConvolution input sequences. (B, T, D_hidden)
      mask: Source mask. (B, T_2)
      cache: ConformerConvolution input cache. (1, D_hidden, conv_kernel)
  
  Returns:
      x: ConformerConvolution output sequences. (B, ?, D_hidden)
      cache: ConformerConvolution output cache. (1, D_hidden, conv_kernel)
docstr_tok: ["Compute","convolution","module",".","Args",":","x",":","ConformerConvolution","input","sequences",".","(","B",",","T",",","D_hidden",")","mask",":","Source","mask",".","(","B",",","T_2",")","cache",":","ConformerConvolution","input","cache",".","(","1",",","D_hidden",",","conv_kernel",")","Returns",":","x",":","ConformerConvolution","output","sequences",".","(","B",",","?",",","D_hidden",")","cache",":","ConformerConvolution","output","cache",".","(","1",",","D_hidden",",","conv_kernel",")"]
code: def forward(
      self,
      x: torch.Tensor,
      mask: Optional[torch.Tensor] = None,
      cache: Optional[torch.Tensor] = None,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Compute convolution module.
  
      Args:
          x: ConformerConvolution input sequences. (B, T, D_hidden)
          mask: Source mask. (B, T_2)
          cache: ConformerConvolution input cache. (1, D_hidden, conv_kernel)
  
      Returns:
          x: ConformerConvolution output sequences. (B, ?, D_hidden)
          cache: ConformerConvolution output cache. (1, D_hidden, conv_kernel)
  
      """
      x = self.pointwise_conv1(x.transpose(1, 2))
      x = torch.nn.functional.glu(x, dim=1)
  
      if mask is not None:
          x.masked_fill_(mask.unsqueeze(1).expand_as(x), 0.0)
  
      if self.lorder > 0:
          if cache is None:
              x = torch.nn.functional.pad(
                  x, (self.lorder, 0), "constant", 0.0
              )
          else:
              x = torch.cat([cache, x], dim=2)
              cache = x[..., -self.lorder :]
  
      x = self.depthwise_conv(x)
      x = self.activation(self.norm(x))
  
      x = self.pointwise_conv2(x).transpose(1, 2)
  
      return x, cache
  
file_path: espnet/espnet2/asr_transducer/encoder/modules/convolution.py
imports: from typing import Dict, Optional, Tuple
  import torch
label_desc: Use image node_id 2 for calling the ConformerConvolution obj's underlying member method code with example usage: obj.forward(x, mask, cache) and returns: x,  cache