code: def check_amp_fuse(
      net,
      data_example,
      expected_sym=None,
      quantized_nodes=[],
      rtol=0.05,
  ):
      net.hybridize()
      out_ref = net(*data_example)
  
      net.optimize_for(
          data_example, backend=SG_PASS_NAME
      )  # amp pass works only on oneDNN nodes
      lp_net = amp.convert_hybrid_block(
          net,
          data_example,
          target_dtype=AMP_DTYPE,
          excluded_sym_names=quantized_nodes,
          cast_params_offline=True,
          device=mx.current_context(),
      )
      lp_net.optimize_for(data_example, backend=AMP_SG_PASS_NAME)
      out_lp_net = lp_net(*data_example)
  
      # check outputs
      out_ref = [out_ref] if not isinstance(out_ref, list) else out_ref
      out_lp_net = (
          [out_lp_net] if not isinstance(out_ref, list) else out_lp_net
      )
      for ref_out, lp_out in zip(out_ref, out_lp_net):
          assert_almost_equal(ref_out, lp_out, rtol=rtol, atol=1.0)
  
      # check graph
      if expected_sym is not None:
          lp_symnet = lp_net.export(None, remove_amp_cast=False)[0]
          same_graph_structure(lp_symnet, expected_sym, True)
  
file_path: mxnet/tests/python/dnnl/subgraphs/test_amp_subgraph.py
imports: import json
  import mxnet
  from mxnet import amp
  from mxnet.gluon import nn
  from mxnet.test_utils import assert_almost_equal
  from subgraph_common import SG_PASS_NAME, QUANTIZE_SG_PASS_NAME
  from test_matmul_subgraph import MultiHeadAttention
  import os
  import sys
  from pathlib import Path
  from amp.common import check_amp_net_stats
label_desc: Use image node_id 2 for calling a global function with example usage: check_amp_fuse(net, data_example, expected_sym, quantized_nodes, rtol) without return types