class_docstr: Non Pre-activation bottleneck block, equiv to V1.5/V1b Bottleneck. Used for ViT.
      
class_docstr_tok: ["Non","Pre-activation","bottleneck","block",",","equiv","to","V1.5\/V1b","Bottleneck",".","Used","for","ViT","."]
code: def __init__(
      self,
      in_chs,
      out_chs=None,
      bottle_ratio=0.25,
      stride=1,
      dilation=1,
      first_dilation=None,
      groups=1,
      act_layer=None,
      conv_layer=None,
      norm_layer=None,
      proj_layer=None,
      drop_path_rate=0.0,
  ):
      super().__init__()
      first_dilation = first_dilation or dilation
      act_layer = act_layer or nn.ReLU
      conv_layer = conv_layer or StdConv2d
      norm_layer = norm_layer or partial(GroupNormAct, num_groups=32)
      out_chs = out_chs or in_chs
      mid_chs = make_divisible(out_chs * bottle_ratio)
  
      if proj_layer is not None:
          self.downsample = proj_layer(
              in_chs,
              out_chs,
              stride=stride,
              dilation=dilation,
              preact=False,
              conv_layer=conv_layer,
              norm_layer=norm_layer,
          )
      else:
          self.downsample = None
  
      self.conv1 = conv_layer(in_chs, mid_chs, 1)
      self.norm1 = norm_layer(mid_chs)
      self.conv2 = conv_layer(
          mid_chs,
          mid_chs,
          3,
          stride=stride,
          dilation=first_dilation,
          groups=groups,
      )
      self.norm2 = norm_layer(mid_chs)
      self.conv3 = conv_layer(mid_chs, out_chs, 1)
      self.norm3 = norm_layer(out_chs, apply_act=False)
      self.drop_path = (
          DropPath(drop_path_rate)
          if drop_path_rate > 0
          else nn.Identity()
      )
      self.act3 = act_layer(inplace=True)
  
imports: from collections import OrderedDict
  from functools import partial
  import torch
  import torch.nn
  from timm.data import IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from timm.layers import GroupNormAct, BatchNormAct2d, EvoNorm2dS0, FilterResponseNormTlu2d, ClassifierHead, DropPath, AvgPool2dSame, create_pool2d, StdConv2d, create_conv2d, get_act_layer, get_norm_act_layer, make_divisible
  from ._builder import build_model_with_cfg
  from ._manipulate import checkpoint_seq, named_apply, adapt_input_conv
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 1 to create a new Bottleneck object from inherited base classes: nn with example: obj = Bottleneck(in_chs, out_chs, bottle_ratio, stride, dilation, first_dilation, groups, act_layer, conv_layer, norm_layer, proj_layer, drop_path_rate)