class_docstr: Skip connection with pre-activation, which includes BatchNorm3D and ReLU,
      in ResNet3D model (https://arxiv.org/abs/1603.05027).
code: def __init__(
      self,
      dim_in,
      dim_out,
      temporal_stride,
      spatial_stride,
      inplace_relu=True,
      bn_eps=1e-5,
      bn_mmt=0.1,
      disable_pre_activation=False,
      **kwargs,
  ):
      super(PreactivatedShortcutTransformation, self).__init__()
      # Use skip connection with projection if dim or spatial/temporal res change.
      assert (
          (dim_in != dim_out)
          or (spatial_stride != 1)
          or (temporal_stride != 1)
      )
      if not disable_pre_activation:
          self.branch1_bn = nn.BatchNorm3d(
              dim_in, eps=bn_eps, momentum=bn_mmt
          )
          self.branch1_relu = nn.ReLU(inplace=inplace_relu)
      self.branch1 = nn.Conv3d(
          dim_in,
          dim_out,
          kernel_size=1,
          stride=[temporal_stride, spatial_stride, spatial_stride],
          padding=0,
          bias=False,
      )
  
imports: import torch.nn
  from .r2plus1_util import r2plus1_unit
label_desc: Use image node_id 1 to create a new PreactivatedShortcutTransformation object from inherited base classes: nn with example: obj = PreactivatedShortcutTransformation(dim_in, dim_out, temporal_stride, spatial_stride, inplace_relu, bn_eps, bn_mmt, disable_pre_activation)