class_docstr: ConvBlock3D
class_docstr_tok: ["ConvBlock3D"]
code: def _forward(self, x: Tensor) -> Tensor:
      device = x.device
      if (
          self.dim_pad > 0
          and self.conv_2 is None
          and self.causal is True
      ):
          x = self._cat_stream_buffer(x, device)
      shape_with_buffer = x.shape
      if self.conv_type == "2plus1d":
          x = rearrange(x, "b c t h w -> (b t) c h w")
      x = self.conv_1(x)
      if self.conv_type == "2plus1d":
          x = rearrange(
              x, "(b t) c h w -> b c t h w", t=shape_with_buffer[2]
          )
  
          if self.conv_2 is not None:
              if self.dim_pad > 0 and self.causal is True:
                  x = self._cat_stream_buffer(x, device)
              w = x.shape[-1]
              x = rearrange(x, "b c t h w -> b c t (h w)")
              x = self.conv_2(x)
              x = rearrange(x, "b c t (h w) -> b c t h w", w=w)
      return x
  
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 2 for calling the ConvBlock3D obj's underlying member method code with example usage: obj._forward(x) and returns: x