class_docstr: Residual Network, see https://arxiv.org/abs/1512.03385
  Args:
      depth (int): ResNet depth, should be 34, 50.
      freeze_at (int): freeze the backbone at which stage
      norm_type (str): normalization type, 'bn'/'sync_bn'/'affine_channel'
      freeze_norm (bool): freeze normalization layers
      norm_decay (float): weight decay for normalization layer weights
      variant (str): ResNet variant, supports 'a', 'b', 'c', 'd' currently
      feature_maps (list): index of stages whose feature maps are returned
      dcn_v2_stages (list): index of stages who select deformable conv v2
      nonlocal_stages (list): index of stages who select nonlocal networks
class_docstr_tok: ["Residual","Network",",","see","https",":","\/\/arxiv.org\/abs\/1512.03385","Args",":","depth","(","int",")",":","ResNet","depth",",","should","be","34",",","50.","freeze_at","(","int",")",":","freeze","the","backbone","at","which","stage","norm_type","(","str",")",":","normalization","type",",","'bn'\/'sync_bn'\/'affine_channel'","freeze_norm","(","bool",")",":","freeze","normalization","layers","norm_decay","(","float",")",":","weight","decay","for","normalization","layer","weights","variant","(","str",")",":","ResNet","variant",",","supports","'","a","'",",","'","b","'",",","'","c","'",",","'d","'","currently","feature_maps","(","list",")",":","index","of","stages","whose","feature","maps","are","returned","dcn_v2_stages","(","list",")",":","index","of","stages","who","select","deformable","conv","v2","nonlocal_stages","(","list",")",":","index","of","stages","who","select","nonlocal","networks"]
code: def bottleneck(
      self, input, num_filters, stride, is_first, name, dcn_v2=False
  ):
      if self.variant == "a":
          stride1, stride2 = stride, 1
      else:
          stride1, stride2 = 1, stride
  
      # ResNeXt
      groups = getattr(self, "groups", 1)
      group_width = getattr(self, "group_width", -1)
      if groups == 1:
          expand = 4
      elif (groups * group_width) == 256:
          expand = 1
      else:  # FIXME hard code for now, handles 32x4d, 64x4d and 32x8d
          num_filters = num_filters // 2
          expand = 2
  
      (
          conv_name1,
          conv_name2,
          conv_name3,
          shortcut_name,
      ) = self.na.fix_bottleneck_name(name)
      std_senet = getattr(self, "std_senet", False)
      if std_senet:
          conv_def = [
              [int(num_filters / 2), 1, stride1, "relu", 1, conv_name1],
              [num_filters, 3, stride2, "relu", groups, conv_name2],
              [num_filters * expand, 1, 1, None, 1, conv_name3],
          ]
      else:
          conv_def = [
              [num_filters, 1, stride1, "relu", 1, conv_name1],
              [num_filters, 3, stride2, "relu", groups, conv_name2],
              [num_filters * expand, 1, 1, None, 1, conv_name3],
          ]
  
      residual = input
      for i, (c, k, s, act, g, _name) in enumerate(conv_def):
          residual = self._conv_norm(
              input=residual,
              num_filters=c,
              filter_size=k,
              stride=s,
              act=act,
              groups=g,
              name=_name,
              dcn_v2=(i == 1 and dcn_v2),
          )
      short = self._shortcut(
          input,
          num_filters * expand,
          stride,
          is_first=is_first,
          name=shortcut_name,
      )
      # Squeeze-and-Excitation
      if callable(getattr(self, "_squeeze_excitation", None)):
          residual = self._squeeze_excitation(
              input=residual, num_channels=num_filters, name="fc" + name
          )
      return fluid.layers.elementwise_add(
          x=short, y=residual, act="relu", name=name + ".add.output.5"
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from collections import OrderedDict
  from numbers import Integral
  from paddle import fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.framework import Variable
  from paddle.fluid.regularizer import L2Decay
  from paddle.fluid.initializer import Constant
  from .nonlocal_helper import add_space_nonlocal
  from .name_adapter import NameAdapter
label_desc: Use image node_id 5 for calling the ResNet obj's underlying member method code with example usage: obj.bottleneck(input, num_filters, stride, is_first, name, dcn_v2) and returns: fluid