code: def test_amp_node_excluding(lp_dtype):
      DISABLE_AMP_ATTR_DICT = {
          "__opt_constraint__": str(
              mx.gluon.HybridBlock.OptConstraint.Flag.DisableAMP.value
          )
      }
  
      data = mx.sym.var("data")
      wei = mx.sym.var("weights")
      bias = mx.sym.var("bias")
      # manually excluded
      fc1 = mx.sym.FullyConnected(
          data,
          wei,
          bias,
          num_hidden=4,
          name="fc1",
          attr=DISABLE_AMP_ATTR_DICT,
      )
      # to be excluded using the conversion API
      fc2 = mx.sym.FullyConnected(
          data, wei, bias, num_hidden=4, name="fc2"
      )
      symnet = mx.sym.Group([fc1, fc2])
  
      net = mx.gluon.SymbolBlock(symnet, [data])
      net.initialize()
  
      # exclude only nodes with set attribute (only 1 node - `fc1`)
      data_example = mx.np.random.uniform(-1, 1, (4, 16))
      net_1_excluded = amp.convert_hybrid_block(
          net, data_example, lp_dtype
      )
  
      lp16_tensors = (
          4  # cast `data`, weights and bias of `fc1`, `fc1` output
      )
      lp16_casts = 3  # `data` cast, casts for weights and bias of `fc1`
      other_casts = 1  # cast for the network output (from lp16 to f32)
      check_amp_net_stats(
          lp_dtype,
          net_1_excluded,
          data_example,
          lp16_tensors_num=lp16_tensors,
          lp16_casts_num=lp16_casts,
          other_casts_num=other_casts,
      )
  
      # exclude using the `excluded_sym_names` argument (both nodes)
      net_2_excluded = amp.convert_hybrid_block(
          net, data_example, lp_dtype, excluded_sym_names=["fc1", "fc2"]
      )
      check_amp_net_stats(
          lp_dtype,
          net_2_excluded,
          data_example,
          lp16_tensors_num=0,
          lp16_casts_num=0,
          other_casts_num=0,
      )
  
file_path: mxnet/tests/python/amp/common.py
imports: import warnings
  import collections
  import mxnet
  from mxnet import amp
  from mxnet.gluon import nn
  from mxnet.operator import get_all_registered_operators_grouped
label_desc: Use image node_id 6 for calling a global function with example usage: test_amp_node_excluding(lp_dtype) without return types