code: def test_bf16_op(op_name, args_scenario):
      (
          symblock,
          bf16_symblock_input_data,
      ) = get_symblock_from_args_scenario(op_name, args_scenario)
      rtol, atol = args_scenario.get(CFG_RTOL_ATOL, (0.01, None))
  
      fp32_symblock_input_data = []
      for tensor in bf16_symblock_input_data:
          if mx.nd.get_dtype_name(tensor.dtype) == "bfloat16":
              tensor = tensor.astype("float32")
          fp32_symblock_input_data.append(tensor)
  
      try:
          bf16_outs = symblock(*bf16_symblock_input_data)
          fp32_outs = symblock(*fp32_symblock_input_data)
          mx.nd.waitall()
      except mx.MXNetError as e:
          pytest.fail(str(e))
  
      if not isinstance(bf16_outs, (list, tuple)):
          bf16_outs = [bf16_outs]
      if not isinstance(fp32_outs, (list, tuple)):
          fp32_outs = [fp32_outs]
  
      assert any(
          mx.nd.get_dtype_name(tensor.dtype) == "bfloat16"
          for tensor in bf16_symblock_input_data + bf16_outs
      )
      assert len(bf16_outs) == len(fp32_outs)
      for bf16_out, fp32_out in zip(bf16_outs, fp32_outs):
          assert_almost_equal(
              bf16_out.astype("float32"),
              fp32_out.astype("float32"),
              rtol,
              atol,
          )
  
file_path: mxnet/tests/python/dnnl/test_amp.py
imports: import sys
  from pathlib import Path
  import pytest
  import mxnet
  import amp.common
  from mxnet.test_utils import assert_almost_equal
  from mxnet.amp.lists.symbol_bf16 import BF16_FUNCS, BF16_FP32_FUNCS, WIDEST_TYPE_CASTS, CONDITIONAL_FP32_FUNCS
  from op_cfg import get_op_cfg_generator, get_symblock_from_args_scenario, CFG_RTOL_ATOL
label_desc: Use image node_id 9 for calling a global function with example usage: test_bf16_op(op_name, args_scenario) without return types