class_docstr: A causal version of nn.Conv1d where each step would have limited access to locations on its right or left
  All arguments are the same as nn.Conv1d except padding.
  
  If padding is set None, then paddings are set automatically to make it a causal convolution where each location would not see any steps on its right.
  
  If padding is set as a list (size of 2), then padding[0] would be used as left padding and padding[1] as right padding.
  It would make it possible to control the number of steps to be accessible on the right and left.
  This mode is not supported when stride > 1. padding[0]+padding[1] should be equal to (kernel_size - 1).
class_docstr_tok: ["A","causal","version","of","nn.Conv1d","where","each","step","would","have","limited","access","to","locations","on","its","right","or","left","All","arguments","are","the","same","as","nn.Conv1d","except","padding",".","If","padding","is","set","None",",","then","paddings","are","set","automatically","to","make","it","a","causal","convolution","where","each","location","would","not","see","any","steps","on","its","right",".","If","padding","is","set","as","a","list","(","size","of","2",")",",","then","padding","[","0","]","would","be","used","as","left","padding","and","padding","[","1","]","as","right","padding",".","It","would","make","it","possible","to","control","the","number","of","steps","to","be","accessible","on","the","right","and","left",".","This","mode","is","not","supported","when","stride",">","1.","padding","[","0","]","+padding","[","1","]","should","be","equal","to","(","kernel_size","-","1",")","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      kernel_size: int,
      stride: int = 1,
      padding: Union[str, int] = 0,
      dilation: int = 1,
      groups: int = 1,
      bias: bool = True,
      padding_mode: str = "zeros",
      device=None,
      dtype=None,
  ) -> None:
      self.cache_drop_size = None
      if padding is None:
          self._left_padding = kernel_size - 1
          self._right_padding = stride - 1
      else:
          if stride != 1 and padding != kernel_size - 1:
              raise ValueError(
                  "No striding allowed for non-symmetric convolutions!"
              )
          if isinstance(padding, int):
              self._left_padding = padding
              self._right_padding = padding
          elif (
              isinstance(padding, list)
              and len(padding) == 2
              and padding[0] + padding[1] == kernel_size - 1
          ):
              self._left_padding = padding[0]
              self._right_padding = padding[1]
          else:
              raise ValueError(f"Invalid padding param: {padding}!")
  
      self._max_cache_len = self._left_padding
  
      super(CausalConv1D, self).__init__(
          in_channels=in_channels,
          out_channels=out_channels,
          kernel_size=kernel_size,
          stride=stride,
          padding=0,
          dilation=dilation,
          groups=groups,
          bias=bias,
          padding_mode=padding_mode,
          device=device,
          dtype=dtype,
      )
  
file_path: NeMo/nemo/collections/asr/parts/submodules/causal_convs.py
imports: from typing import Union
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 to create a new CausalConv1D object from inherited base classes: nn with example: obj = CausalConv1D(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode, device, dtype)