class_docstr: Basic unit containing Conv3D + BatchNorm + non-linearity.
class_docstr_tok: ["Basic","unit","containing","Conv3D","+","BatchNorm","+","non-linearity","."]
docstr: Initializes Unit3D module.
docstr_tok: ["Initializes","Unit3D","module","."]
code: def __init__(
      self,
      in_channels,
      output_channels,
      kernel_shape=(1, 1, 1),
      stride=(1, 1, 1),
      padding=0,
      activation_fn=F.relu,
      use_batch_norm=True,
      use_bias=False,
      name="unit_3d",
  ):
      """Initializes Unit3D module."""
  
      super(Unit3D, self).__init__()
  
      self._output_channels = output_channels
      self._kernel_shape = kernel_shape
      self._stride = stride
      self._use_batch_norm = use_batch_norm
      self._activation_fn = activation_fn
      self._use_bias = use_bias
      self.name = name
      self.padding = padding
  
      self.conv3d = nn.Conv3d(
          in_channels=in_channels,
          out_channels=self._output_channels,
          kernel_size=self._kernel_shape,
          stride=self._stride,
          padding=0,
          # we always want padding to be 0 here. We will dynamically pad based on input size in
          # forward function
          bias=self._use_bias,
      )
  
      if self._use_batch_norm:
          self.bn = nn.BatchNorm3d(
              self._output_channels, eps=0.001, momentum=0.01
          )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.hub import load_state_dict_from_url
label_desc: Use image node_id 1 to create a new Unit3D object from inherited base classes: nn with example: obj = Unit3D(in_channels, output_channels, kernel_shape, stride, padding, activation_fn, use_batch_norm, use_bias, name)