code: def test_batch_matmul_simple(target_precision):
      """Batch matmul is a special case where we try to accumulate to fp16.
  
      This is due to the fact heterogenous accumulation dtypes does not work
      on all platforms at the moment.
      """
      data = relay.var("data", shape=[1, 1, 20])
      weight = relay.var("weight", shape=[1, 20, 20])
      a = relay.nn.batch_matmul(data, weight)
      mod = tvm.IRModule.from_expr(a)
      mod_params = {
          "data": np.random.uniform(-1, 1, size=[1, 1, 20]).astype(
              "float32"
          ),
          "weight": np.random.uniform(-1, 1, size=[1, 20, 20]).astype(
              "float32"
          ),
      }
      output_mod = verify_mixed_precision_output_close(
          mod,
          mod_params,
          mixed_precision_dtype=target_precision,
          atol=0.01,
          rtol=0.01,
      )
      # Create expected module
      data = relay.cast(
          relay.var("data", shape=[1, 1, 20]), target_precision
      )
      weight = relay.cast(
          relay.var("weight", shape=[1, 20, 20]), target_precision
      )
      a = relay.nn.batch_matmul(
          data, weight, out_dtype=target_precision
      )
      expected_mod = tvm.IRModule.from_expr(a)
      expected_mod = InferType()(expected_mod)
      assert tvm.ir.structural_equal(expected_mod, output_mod)
  
imports: from typing import Any, Dict, List
  import numpy
  import pytest
  import tvm
  from tvm import relay
  from tvm.relay.testing import lstm
  from tvm.relay.transform import InferType, ToMixedPrecision, mixed_precision
label_desc: Use image node_id 16 for calling a global function with example usage: test_batch_matmul_simple(target_precision) without return types