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 _conv_norm(
      self,
      input,
      num_filters,
      filter_size,
      stride=1,
      groups=1,
      act=None,
      name=None,
      dcn_v2=False,
  ):
      _name = (
          self.prefix_name + name if self.prefix_name != "" else name
      )
      if not dcn_v2:
          conv = fluid.layers.conv2d(
              input=input,
              num_filters=num_filters,
              filter_size=filter_size,
              stride=stride,
              padding=(filter_size - 1) // 2,
              groups=groups,
              act=None,
              param_attr=ParamAttr(name=_name + "_weights"),
              bias_attr=False,
              name=_name + ".conv2d.output.1",
          )
      else:
          # select deformable conv"
          offset_mask = self._conv_offset(
              input=input,
              filter_size=filter_size,
              stride=stride,
              padding=(filter_size - 1) // 2,
              act=None,
              name=_name + "_conv_offset",
          )
          offset_channel = filter_size**2 * 2
          mask_channel = filter_size**2
          offset, mask = fluid.layers.split(
              input=offset_mask,
              num_or_sections=[offset_channel, mask_channel],
              dim=1,
          )
          mask = fluid.layers.sigmoid(mask)
          conv = fluid.layers.deformable_conv(
              input=input,
              offset=offset,
              mask=mask,
              num_filters=num_filters,
              filter_size=filter_size,
              stride=stride,
              padding=(filter_size - 1) // 2,
              groups=groups,
              deformable_groups=1,
              im2col_step=1,
              param_attr=ParamAttr(name=_name + "_weights"),
              bias_attr=False,
              name=_name + ".conv2d.output.1",
          )
  
      bn_name = self.na.fix_conv_norm_name(name)
      bn_name = (
          self.prefix_name + bn_name
          if self.prefix_name != ""
          else bn_name
      )
  
      norm_lr = 0.0 if self.freeze_norm else 1.0
      norm_decay = self.norm_decay
      pattr = ParamAttr(
          name=bn_name + "_scale",
          learning_rate=norm_lr,
          regularizer=L2Decay(norm_decay),
      )
      battr = ParamAttr(
          name=bn_name + "_offset",
          learning_rate=norm_lr,
          regularizer=L2Decay(norm_decay),
      )
  
      if self.norm_type in ["bn", "sync_bn"]:
          global_stats = True if self.freeze_norm else False
          out = fluid.layers.batch_norm(
              input=conv,
              act=act,
              name=bn_name + ".output.1",
              param_attr=pattr,
              bias_attr=battr,
              moving_mean_name=bn_name + "_mean",
              moving_variance_name=bn_name + "_variance",
              use_global_stats=global_stats,
          )
          scale = fluid.framework._get_var(pattr.name)
          bias = fluid.framework._get_var(battr.name)
      elif self.norm_type == "affine_channel":
          scale = fluid.layers.create_parameter(
              shape=[conv.shape[1]],
              dtype=conv.dtype,
              attr=pattr,
              default_initializer=fluid.initializer.Constant(1.0),
          )
          bias = fluid.layers.create_parameter(
              shape=[conv.shape[1]],
              dtype=conv.dtype,
              attr=battr,
              default_initializer=fluid.initializer.Constant(0.0),
          )
          out = fluid.layers.affine_channel(
              x=conv, scale=scale, bias=bias, act=act
          )
      if self.freeze_norm:
          scale.stop_gradient = True
          bias.stop_gradient = True
      return out
  
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 3 for calling the ResNet obj's underlying member method code with example usage: obj._conv_norm(input, num_filters, filter_size, stride, groups, act, name, dcn_v2) and returns: out