code: def test_recast_medium():
      """Recast a slightly larger graph."""
  
      def before():
          x = relay.var("x", shape=[8, 8, 8, 8])
          w = relay.var("w", shape=[8, 8, 3, 3])
          c = relay.nn.conv2d(x, w, padding=(1, 1), out_dtype="float32")
          w2 = relay.var("w2", shape=[8, 8, 3, 3])
          c2 = relay.nn.conv2d(
              c, w2, padding=(1, 1), out_dtype="float32"
          )
          return relay.Function([x, w, w2], c2)
  
      def expected():
          x = relay.var("x", shape=[8, 8, 8, 8])
          w = relay.var("w", shape=[8, 8, 3, 3])
          x_int = relay.cast(x, "int8")
          w_int = relay.cast(w, "int8")
          c = relay.nn.conv2d(
              x_int, w_int, padding=(1, 1), out_dtype="int32"
          )
          c_float = relay.cast(c, "float32")
          w2 = relay.var("w2", shape=[8, 8, 3, 3])
          w2_int = relay.cast(w2, "int8")
          c_float_int = relay.cast(c_float, "int8")
          c2 = relay.nn.conv2d(
              c_float_int, w2_int, padding=(1, 1), out_dtype="int32"
          )
          c2_float = relay.cast(c2, "float32")
          return relay.Function([x, w, w2], c2_float)
  
      pre = before()
      post = recast(pre, "int8", "int32")
      expected = expected()
      assert tvm.ir.structural_equal(expected, post)
  
file_path: tvm/tests/python/relay/test_recast.py
imports: import tvm
  from tvm import relay
  from tvm.relay.transform import recast
label_desc: Use image node_id 2 for calling a global function with example usage: test_recast_medium() and returns: relay, relay