code: def __init__(
      self,
      in_channels,
      bottleneck_channels,
      out_channels,
      stride=1,
      groups=1,
      dilation=1,
      norm_func=None,
      use_cudnn=False,
      explicit_nhwc=False,
  ):
      super(Bottleneck, self).__init__()
      if groups != 1:
          raise RuntimeError("Only support groups == 1")
      if dilation != 1:
          raise RuntimeError("Only support dilation == 1")
      if norm_func == None:
          norm_func = FrozenBatchNorm2d
      else:
          raise RuntimeError("Only support frozen BN now.")
  
      if stride != 1 or in_channels != out_channels:
          self.downsample = nn.Sequential(
              conv1x1(in_channels, out_channels, stride),
              norm_func(out_channels),
          )
      else:
          self.downsample = None
  
      # Both self.conv2 and self.downsample layers downsample the input when stride != 1
      self.conv1 = conv1x1(in_channels, bottleneck_channels, stride)
      self.conv2 = conv3x3(bottleneck_channels, bottleneck_channels)
      self.conv3 = conv1x1(bottleneck_channels, out_channels)
      self.relu = nn.ReLU(inplace=True)
      self.stride = stride
  
      self.bn1 = norm_func(bottleneck_channels)
      self.bn2 = norm_func(bottleneck_channels)
      self.bn3 = norm_func(out_channels)
      self.w_scale = None
  
      self.use_cudnn = use_cudnn
  
      # setup conv weights
      self.w_conv = [
          self.conv1.weight,
          self.conv2.weight,
          self.conv3.weight,
      ]
      if self.downsample is not None:
          self.w_conv.append(self.downsample[0].weight)
  
      # init weight in nchw format before possible transpose
      for w in self.w_conv:
          kaiming_uniform_(w, a=1)
  
      # TODO: prevent unsupported case usage
      # support cases
      #                 native      cudnn
      # normal             yes         no
      # channel_last       yes        yes
      # explicit_nhwc       no        yes
      self.explicit_nhwc = explicit_nhwc
      if self.explicit_nhwc:
          for p in self.parameters():
              with torch.no_grad():
                  p.data = p.data.permute(0, 2, 3, 1).contiguous()
  
      return
  
imports: import functools
  import torch
  import torch.distributed
  from torch import nn
  from apex import check_cudnn_version_and_warn
  import fast_bottleneck
  import nccl_p2p_cuda
label_desc: Use image node_id 1 to create a new Bottleneck object from inherited base classes: torch.nn with example: obj = Bottleneck(in_channels, bottleneck_channels, out_channels, stride, groups, dilation, norm_func, use_cudnn, explicit_nhwc)