class_docstr: ConvBlock3D
class_docstr_tok: ["ConvBlock3D"]
code: def __init__(
      self,
      in_planes: int,
      out_planes: int,
      *,
      kernel_size: Union[int, Tuple[int, int, int]],
      tf_like: bool,
      causal: bool,
      conv_type: str,
      padding: Union[int, Tuple[int, int, int]] = 0,
      stride: Union[int, Tuple[int, int, int]] = 1,
      norm_layer: Optional[Callable[..., nn.Module]] = None,
      activation_layer: Optional[Callable[..., nn.Module]] = None,
      bias: bool = False,
      **kwargs: Any,
  ) -> None:
      super().__init__()
      kernel_size = _triple(kernel_size)
      stride = _triple(stride)
      padding = _triple(padding)
      self.conv_2 = None
      if tf_like:
          # We neek odd kernel to have even padding
          # and stride == 1 to precompute padding,
          if kernel_size[0] % 2 == 0:
              raise ValueError(
                  "tf_like supports only odd"
                  + " kernels for temporal dimension"
              )
          padding = ((kernel_size[0] - 1) // 2, 0, 0)
          if stride[0] != 1:
              raise ValueError(
                  "illegal stride value, tf like supports"
                  + " only stride == 1 for temporal dimension"
              )
          if stride[1] > kernel_size[1] or stride[2] > kernel_size[2]:
              # these values are not tested so should be avoided
              raise ValueError(
                  "tf_like supports only"
                  + "  stride <= of the kernel size"
              )
  
      if causal is True:
          padding = (0, padding[1], padding[2])
      if "2plus1d" not in conv_type and "3d" not in conv_type:
          raise ValueError(
              "only 2plus2d or 3d are " + "allowed as 3d convolutions"
          )
  
      if conv_type == "2plus1d":
          self.conv_1 = Conv2dBNActivation(
              in_planes,
              out_planes,
              kernel_size=(kernel_size[1], kernel_size[2]),
              padding=(padding[1], padding[2]),
              stride=(stride[1], stride[2]),
              activation_layer=activation_layer,
              norm_layer=norm_layer,
              bias=bias,
              **kwargs,
          )
          if kernel_size[0] > 1:
              self.conv_2 = Conv2dBNActivation(
                  in_planes,
                  out_planes,
                  kernel_size=(kernel_size[0], 1),
                  padding=(padding[0], 0),
                  stride=(stride[0], 1),
                  activation_layer=activation_layer,
                  norm_layer=norm_layer,
                  bias=bias,
                  **kwargs,
              )
      elif conv_type == "3d":
          self.conv_1 = Conv3DBNActivation(
              in_planes,
              out_planes,
              kernel_size=kernel_size,
              padding=padding,
              activation_layer=activation_layer,
              norm_layer=norm_layer,
              stride=stride,
              bias=bias,
              **kwargs,
          )
      self.padding = padding
      self.kernel_size = kernel_size
      self.dim_pad = self.kernel_size[0] - 1
      self.stride = stride
      self.causal = causal
      self.conv_type = conv_type
      self.tf_like = tf_like
  
imports: from typing import Any, Callable, Optional, Tuple, Union
  from einops import rearrange
  import torch
  from torch.nn.modules.utils import _triple
  import torch.nn.functional
  from torch import nn, Tensor
  from towhee.models.utils.general_utils import make_divisible
  from towhee.models.utils.causal_module import CausalModule
  from towhee.models.layers.activations import HardSigmoid
  from towhee.models.layers.conv_bn_activation import Conv2dBNActivation, Conv3DBNActivation
  from towhee.models.layers.padding_functions import same_padding
  from towhee.models.layers.tf_avgpool3d import TfAvgPool3D
  from towhee.models.layers.temporal_cg_avgpool3d import TemporalCGAvgPool3D
label_desc: Use image node_id 1 to create a new ConvBlock3D object from inherited base classes: CausalModule with example: obj = ConvBlock3D(in_planes, out_planes)