class_docstr: Conv1d module definition.
  
  Args:
      input_size: Input dimension.
      output_size: Output dimension.
      kernel_size: Size of the convolving kernel.
      stride: Stride of the convolution.
      dilation: Spacing between the kernel points.
      groups: Number of blocked connections from input channels to output channels.
      bias: Whether to add a learnable bias to the output.
      batch_norm: Whether to use batch normalization after convolution.
      relu: Whether to use a ReLU activation after convolution.
      causal: Whether to use causal convolution (set to True if streaming).
      dropout_rate: Dropout rate.
docstr: Encode chunk of input sequence.
  
  Args:
      x: Conv1d input sequences. (B, T, D_in)
      pos_enc: Positional embedding sequences. (B, 2 * (T - 1), D_in)
      mask: Source mask. (B, T)
      left_context: Number of previous frames the attention module can see
                    in current chunk (not used here).
  
  Returns:
      x: Conv1d output sequences. (B, T, D_out)
      pos_enc: Positional embedding sequences. (B, 2 * (T - 1), D_out)
docstr_tok: ["Encode","chunk","of","input","sequence",".","Args",":","x",":","Conv1d","input","sequences",".","(","B",",","T",",","D_in",")","pos_enc",":","Positional","embedding","sequences",".","(","B",",","2","*","(","T","-","1",")",",","D_in",")","mask",":","Source","mask",".","(","B",",","T",")","left_context",":","Number","of","previous","frames","the","attention","module","can","see","in","current","chunk","(","not","used","here",")",".","Returns",":","x",":","Conv1d","output","sequences",".","(","B",",","T",",","D_out",")","pos_enc",":","Positional","embedding","sequences",".","(","B",",","2","*","(","T","-","1",")",",","D_out",")"]
code: def chunk_forward(
      self,
      x: torch.Tensor,
      pos_enc: torch.Tensor,
      mask: torch.Tensor,
      left_context: int = 0,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Encode chunk of input sequence.
  
      Args:
          x: Conv1d input sequences. (B, T, D_in)
          pos_enc: Positional embedding sequences. (B, 2 * (T - 1), D_in)
          mask: Source mask. (B, T)
          left_context: Number of previous frames the attention module can see
                        in current chunk (not used here).
  
      Returns:
          x: Conv1d output sequences. (B, T, D_out)
          pos_enc: Positional embedding sequences. (B, 2 * (T - 1), D_out)
  
      """
      x = torch.cat([self.cache, x.transpose(1, 2)], dim=2)
      self.cache = x[:, :, -self.lorder :]
  
      x = self.conv(x)
  
      if self.batch_norm:
          x = self.bn(x)
  
      x = self.dropout(x)
  
      if self.relu:
          x = self.relu_func(x)
  
      x = x.transpose(1, 2)
  
      return x, self.out_pos(pos_enc)
  
file_path: espnet/espnet2/asr_transducer/encoder/blocks/conv1d.py
imports: from typing import Optional, Tuple, Union
  import torch
label_desc: Use image node_id 4 for calling the Conv1d obj's underlying member method code with example usage: obj.chunk_forward(x, pos_enc, mask, left_context) and returns: x,  self