class_docstr: Convolution unit of FeatureExtractor
class_docstr_tok: ["Convolution","unit","of","FeatureExtractor"]
docstr: Args:
      x (Tensor): Shape: ``[batch, in_channels, in_frame]``.
      length (Tensor or None, optional): Shape ``[batch, ]``.
  Returns:
      Tensor: Shape ``[batch, out_channels, out_frames]``.
      Optional[Tensor]: Shape ``[batch, ]``.
docstr_tok: ["Args",":","x","(","Tensor",")",":","Shape",":","``","[","batch",",","in_channels",",","in_frame","]","``",".","length","(","Tensor","or","None",",","optional",")",":","Shape","``","[","batch",",","]","``",".","Returns",":","Tensor",":","Shape","``","[","batch",",","out_channels",",","out_frames","]","``",".","Optional","[","Tensor","]",":","Shape","``","[","batch",",","]","``","."]
code: def forward(
      self,
      x: Tensor,
      length: Optional[Tensor],
  ) -> Tuple[Tensor, Optional[Tensor]]:
      """
      Args:
          x (Tensor): Shape: ``[batch, in_channels, in_frame]``.
          length (Tensor or None, optional): Shape ``[batch, ]``.
      Returns:
          Tensor: Shape ``[batch, out_channels, out_frames]``.
          Optional[Tensor]: Shape ``[batch, ]``.
      """
      x = self.conv(x)
      if self.layer_norm is not None:
          x = self.layer_norm(x)
      x = nn.functional.gelu(x)
  
      if length is not None:
          length = (
              torch.div(
                  length - self.kernel_size,
                  self.stride,
                  rounding_mode="floor",
              )
              + 1
          )
          # When input length is 0, the resulting length can be negative. So fix it here.
          length = torch.max(torch.zeros_like(length), length)
      return x, length
  
imports: import logging
  from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import Module, Parameter
  from .wavlm_attention import WavLMSelfAttention
label_desc: Use image node_id 2 for calling the ConvLayerBlock obj's underlying member method code with example usage: obj.forward(x, length) and returns: x,  length