code: def batch_norm(
      ch,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=False,
      initializer=None,
      data_format="NCHW",
  ):
      norm_lr = 0.0 if freeze_norm else 1.0
      weight_attr = ParamAttr(
          initializer=initializer,
          learning_rate=norm_lr,
          regularizer=L2Decay(norm_decay),
          trainable=False if freeze_norm else True,
      )
      bias_attr = ParamAttr(
          learning_rate=norm_lr,
          regularizer=L2Decay(norm_decay),
          trainable=False if freeze_norm else True,
      )
  
      if norm_type in ["sync_bn", "bn"]:
          norm_layer = nn.BatchNorm2D(
              ch,
              weight_attr=weight_attr,
              bias_attr=bias_attr,
              data_format=data_format,
          )
  
      norm_params = norm_layer.parameters()
      if freeze_norm:
          for param in norm_params:
              param.stop_gradient = True
  
      return norm_layer
  
imports: import paddle
  import paddle.nn.functional
  import paddle.nn
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle import in_dynamic_mode
  from paddle.common_ops_import import Variable, LayerHelper, check_variable_and_dtype, check_type, check_dtype
label_desc: Use image node_id 6 for calling a global function with example usage: batch_norm(ch, norm_type, norm_decay, freeze_norm, initializer, data_format) and returns: norm_layer