code: def _freeze_norm(m: nn.BatchNorm2D):
      param_attr = ParamAttr(
          learning_rate=0.0, regularizer=L2Decay(0.0), trainable=False
      )
      bias_attr = ParamAttr(
          learning_rate=0.0, regularizer=L2Decay(0.0), trainable=False
      )
      global_stats = True
      norm = nn.BatchNorm2D(
          m._num_features,
          weight_attr=param_attr,
          bias_attr=bias_attr,
          use_global_stats=global_stats,
      )
      for param in norm.parameters():
          param.stop_gradient = True
      return norm
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingNormal, Constant
  from paddle.nn import Conv2D, BatchNorm2D, ReLU, AdaptiveAvgPool2D, MaxPool2D
  from paddle.regularizer import L2Decay
  from paddle import ParamAttr
  import copy
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 for calling a global function with example usage: _freeze_norm(m) and returns: norm