class_docstr: ## Spatial Depth Wise Shared Convolution
  
  We share the same kernel across all channels.
class_docstr_tok: ["#","#","Spatial","Depth","Wise","Shared","Convolution","We","share","the","same","kernel","across","all","channels","."]
docstr_tok: []
code: def __init__(self, kernel_size: int = 3):
      """ """
      super().__init__()
      self.kernel_size = kernel_size
      # We use PyTorch's `Conv1d` module.
      # We add padding to both sides and later crop the right most `kernel_size - 1` results
      self.conv = nn.Conv1d(
          in_channels=1,
          out_channels=1,
          kernel_size=(kernel_size,),
          padding=(kernel_size - 1,),
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/primer_ez/variations.py
imports: import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.transformers import MultiHeadAttention
label_desc: Use image node_id 1 to create a new SpatialDepthWiseSharedConvolution object from inherited base classes: Module with example: obj = SpatialDepthWiseSharedConvolution(kernel_size)