code: def test_amp_excluding_after_graph_pass():
      class TestNet(nn.HybridBlock):
          def __init__(self):
              super(TestNet, self).__init__()
              self.fc1 = nn.Dense(16)
              self.fc2 = nn.Dense(16)
  
          def forward(self, x):
              x = self.fc1(x)
              with nn.HybridBlock.OptConstraint.disable_amp():
                  x = self.fc2(x)
              return x
  
      data_example = mx.np.random.uniform(-1, 1, (1, 8))
      net = TestNet()
      net.initialize()
  
      net_before = amp.convert_hybrid_block(
          net, data_example, AMP_DTYPE, cast_params_offline=True
      )
      check_amp_net_stats(
          AMP_DTYPE,
          net_before,
          data_example,
          lp16_tensors_num=2,
          lp16_casts_num=1,
          other_casts_num=1,
      )
  
      net.optimize_for(
          data_example, backend=SG_PASS_NAME
      )  # introduces new nodes
      net_after = amp.convert_hybrid_block(
          net, data_example, AMP_DTYPE, cast_params_offline=True
      )
      check_amp_net_stats(
          AMP_DTYPE,
          net_after,
          data_example,
          lp16_tensors_num=2,
          lp16_casts_num=1,
          other_casts_num=1,
      )
  
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 8 for calling a global function with example usage: test_amp_excluding_after_graph_pass() and returns: x