code: def __init__(
      self,
      inplanes,
      planes,
      spatial_stride=1,
      temporal_stride=1,
      dilation=1,
      downsample=None,
      if_inflate=True,
      inflate_style="3x1x1",
      if_nonlocal=True,
      nonlocal_cfg=None,
      norm_layer=BatchNorm3d,
      norm_kwargs=None,
      layer_name="",
      **kwargs,
  ):
      super(Bottleneck, self).__init__()
      assert inflate_style in ["3x1x1", "3x3x3"]
      self.inplanes = inplanes
      self.planes = planes
  
      self.conv1_stride = 1
      self.conv2_stride = spatial_stride
      self.conv1_stride_t = 1
      self.conv2_stride_t = temporal_stride
  
      if if_inflate:
          if inflate_style == "3x1x1":
              self.conv1 = nn.Conv3d(
                  in_channels=inplanes,
                  out_channels=planes,
                  kernel_size=(3, 1, 1),
                  stride=(
                      self.conv1_stride_t,
                      self.conv1_stride,
                      self.conv1_stride,
                  ),
                  padding=(1, 0, 0),
                  bias=False,
              )
              self.conv2 = nn.Conv3d(
                  in_channels=planes,
                  out_channels=planes,
                  kernel_size=(1, 3, 3),
                  stride=(
                      self.conv2_stride_t,
                      self.conv2_stride,
                      self.conv2_stride,
                  ),
                  padding=(0, dilation, dilation),
                  dilation=(1, dilation, dilation),
                  bias=False,
              )
          else:
              self.conv1 = nn.Conv3d(
                  in_channels=inplanes,
                  out_channels=planes,
                  kernel_size=1,
                  stride=(
                      self.conv1_stride_t,
                      self.conv1_stride,
                      self.conv1_stride,
                  ),
                  bias=False,
              )
              self.conv2 = nn.Conv3d(
                  in_channels=planes,
                  out_channels=planes,
                  kernel_size=3,
                  stride=(
                      self.conv2_stride_t,
                      self.conv2_stride,
                      self.conv2_stride,
                  ),
                  padding=(1, dilation, dilation),
                  dilation=(1, dilation, dilation),
                  bias=False,
              )
      else:
          self.conv1 = nn.Conv3d(
              in_channels=inplanes,
              out_channels=planes,
              kernel_size=1,
              stride=(1, self.conv1_stride, self.conv1_stride),
              bias=False,
          )
          self.conv2 = nn.Conv3d(
              in_channels=planes,
              out_channels=planes,
              kernel_size=(1, 3, 3),
              stride=(1, self.conv2_stride, self.conv2_stride),
              padding=(0, dilation, dilation),
              dilation=(1, dilation, dilation),
              bias=False,
          )
  
      self.bn1 = norm_layer(
          num_features=planes,
          **({} if norm_kwargs is None else norm_kwargs),
      )
      self.bn2 = norm_layer(
          num_features=planes,
          **({} if norm_kwargs is None else norm_kwargs),
      )
      self.conv3 = nn.Conv3d(
          in_channels=planes,
          out_channels=planes * self.expansion,
          kernel_size=1,
          bias=False,
      )
      self.bn3 = norm_layer(
          num_features=planes * self.expansion,
          **({} if norm_kwargs is None else norm_kwargs),
      )
      self.downsample = downsample
  
      self.spatial_tride = spatial_stride
      self.temporal_tride = temporal_stride
      self.dilation = dilation
  
      if if_nonlocal and nonlocal_cfg is not None:
          nonlocal_cfg_ = nonlocal_cfg.copy()
          nonlocal_cfg_["in_channels"] = planes * self.expansion
          self.nonlocal_block = build_nonlocal_block(nonlocal_cfg_)
      else:
          self.nonlocal_block = None
  
      self.relu = nn.ReLU(inplace=False)
  
imports: import torch
  import torch.nn
  from torch.nn import BatchNorm3d
  from .non_local import build_nonlocal_block
label_desc: Use image node_id 1 to create a new Bottleneck object from inherited base classes: nn with example: obj = Bottleneck(inplanes, planes, spatial_stride, temporal_stride, dilation, downsample, if_inflate, inflate_style, if_nonlocal, nonlocal_cfg, norm_layer, norm_kwargs, layer_name)