class_docstr: This function implements complex-valued 1d convolution.
  
  Arguments
  ---------
  out_channels : int
      Number of output channels. Please note
      that these are complex-valued neurons. If 256
      channels are specified, the output dimension
      will be 512.
  kernel_size : int
      Kernel size of the convolutional filters.
  stride : int, optional
      Stride factor of the convolutional filters (default 1).
  dilation : int, optional
      Dilation factor of the convolutional filters (default 1).
  padding : str, optional
      (same, valid, causal). If "valid", no padding is performed.
      If "same" and stride is 1, output shape is same as input shape.
      "causal" results in causal (dilated) convolutions. (default "same")
  padding_mode : str, optional
      This flag specifies the type of padding. See torch.nn documentation
      for more information (default "reflect").
  groups : int, optional
      This option specifies the convolutional groups. See torch.nn
      documentation for more information (default 1).
  bias : bool, optional
      If True, the additive bias b is adopted (default True).
  init_criterion : str, optional
      (glorot, he).
      This parameter controls the initialization criterion of the weights.
      It is combined with weights_init to build the initialization method of
      the complex-valued weights. (default "glorot")
  weight_init : str, optional
      (complex, unitary).
      This parameter defines the initialization procedure of the
      complex-valued weights. "complex" will generate random complex-valued
      weights following the init_criterion and the complex polar form.
      "unitary" will normalize the weights to lie on the unit circle. (default "complex")
      More details in: "Deep Complex Networks", Trabelsi C. et al.
  
  Example
  -------
  >>> inp_tensor = torch.rand([10, 16, 30])
  >>> cnn_1d = CConv1d(
  ...     input_shape=inp_tensor.shape, out_channels=12, kernel_size=5
  ... )
  >>> out_tensor = cnn_1d(inp_tensor)
  >>> out_tensor.shape
  torch.Size([10, 16, 24])
class_docstr_tok: ["This","function","implements","complex-valued","1d","convolution",".","Arguments","--","--","--","--","-","out_channels",":","int","Number","of","output","channels",".","Please","note","that","these","are","complex-valued","neurons",".","If","256","channels","are","specified",",","the","output","dimension","will","be","512.","kernel_size",":","int","Kernel","size","of","the","convolutional","filters",".","stride",":","int",",","optional","Stride","factor","of","the","convolutional","filters","(","default","1",")",".","dilation",":","int",",","optional","Dilation","factor","of","the","convolutional","filters","(","default","1",")",".","padding",":","str",",","optional","(","same",",","valid",",","causal",")",".","If","``","valid","''",",","no","padding","is","performed",".","If","``","same","''","and","stride","is","1",",","output","shape","is","same","as","input","shape",".","``","causal","''","results","in","causal","(","dilated",")","convolutions",".","(","default","``","same","''",")","padding_mode",":","str",",","optional","This","flag","specifies","the","type","of","padding",".","See","torch.nn","documentation","for","more","information","(","default","``","reflect","''",")",".","groups",":","int",",","optional","This","option","specifies","the","convolutional","groups",".","See","torch.nn","documentation","for","more","information","(","default","1",")",".","bias",":","bool",",","optional","If","True",",","the","additive","bias","b","is","adopted","(","default","True",")",".","init_criterion",":","str",",","optional","(","glorot",",","he",")",".","This","parameter","controls","the","initialization","criterion","of","the","weights",".","It","is","combined","with","weights_init","to","build","the","initialization","method","of","the","complex-valued","weights",".","(","default","``","glorot","''",")","weight_init",":","str",",","optional","(","complex",",","unitary",")",".","This","parameter","defines","the","initialization","procedure","of","the","complex-valued","weights",".","``","complex","''","will","generate","random","complex-valued","weights","following","the","init_criterion","and","the","complex","polar","form",".","``","unitary","''","will","normalize","the","weights","to","lie","on","the","unit","circle",".","(","default","``","complex","''",")","More","details","in",":","``","Deep","Complex","Networks","''",",","Trabelsi","C.","et","al",".","Example","--","--","--","-",">",">",">","inp_tensor","=","torch.rand","(","[","10",",","16",",","30","]",")",">",">",">","cnn_1d","=","CConv1d","(","...","input_shape=inp_tensor.shape",",","out_channels=12",",","kernel_size=5","...",")",">",">",">","out_tensor","=","cnn_1d","(","inp_tensor",")",">",">",">","out_tensor.shape","torch.Size","(","[","10",",","16",",","24","]",")"]
code: def __init__(
      self,
      out_channels,
      kernel_size,
      input_shape,
      stride=1,
      dilation=1,
      padding="same",
      groups=1,
      bias=True,
      padding_mode="reflect",
      init_criterion="glorot",
      weight_init="complex",
  ):
      super().__init__()
      self.out_channels = out_channels
      self.kernel_size = kernel_size
      self.stride = stride
      self.dilation = dilation
      self.padding = padding
      self.groups = groups
      self.bias = bias
      self.padding_mode = padding_mode
      self.unsqueeze = False
      self.init_criterion = init_criterion
      self.weight_init = weight_init
  
      self.in_channels = self._check_input(input_shape) // 2
  
      # Managing the weight initialization and bias by directly setting the
      # correct function
  
      (self.k_shape, self.w_shape) = self._get_kernel_and_weight_shape()
  
      self.real_weight = torch.nn.Parameter(torch.Tensor(*self.w_shape))
      self.imag_weight = torch.nn.Parameter(torch.Tensor(*self.w_shape))
  
      if self.bias:
          self.b = torch.nn.Parameter(
              torch.Tensor(2 * self.out_channels)
          )
          self.b.data.fill_(0)
      else:
          self.b = None
  
      self.winit = {"complex": complex_init, "unitary": unitary_init}[
          self.weight_init
      ]
  
      affect_conv_init(
          self.real_weight,
          self.imag_weight,
          self.kernel_size,
          self.winit,
          self.init_criterion,
      )
  
imports: import torch
  import torch.nn
  import logging
  import torch.nn.functional
  from speechbrain.nnet.CNN import get_padding_elem
  from speechbrain.nnet.complex_networks.c_ops import unitary_init, complex_init, affect_conv_init, complex_conv_op
label_desc: Use image node_id 1 to create a new CConv1d object from inherited base classes: torch.nn with example: obj = CConv1d(out_channels, kernel_size, input_shape, stride, dilation, padding, groups, bias, padding_mode, init_criterion, weight_init)