code: def test_contrib_intgemm_weight_consistent(shape, max_quant, api):
      # The weight format is actually CPU-dependent so we don't directly test the
      # output, but indirectly test that it works.
      if "intgemm_prepare_weight" not in dir(mx.nd.contrib):
          return
      contrib, top = api
      max_array = top.array([max_quant])
      if top == mx.nd:
          m = top.random_uniform(low=-3.0, high=3.0, shape=shape)
      else:
          m = np.random.uniform(size=shape)
      direct = contrib.intgemm_prepare_weight(m, max_array)
      quant = contrib.intgemm_prepare_data(m, max_array)
      indirect = contrib.intgemm_prepare_weight(
          quant, already_quantized=True
      )
      # Should get the same data from direct call and already_quantized version.
      assert same(direct, indirect)
  
file_path: mxnet/tests/python/unittest/test_contrib_intgemm.py
imports: import mxnet
  from mxnet import np, npx
  from mxnet.test_utils import same, use_np, assert_almost_equal
  import random
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_contrib_intgemm_weight_consistent(shape, max_quant, api) without return types