code: def test_dynamic_to_static_resize2d():
      def verify_resize(shape, scale, method, layout):
          if layout == "NHWC":
              size = (shape[1] * scale, shape[2] * scale)
          else:
              size = (shape[2] * scale, shape[3] * scale)
  
          x = relay.var("x", relay.TensorType(shape, "float32"))
          size_var = relay.var(
              "size", relay.TensorType((len(size),), "float32")
          )
          coord_trans = (
              "asymmetric"
              if method == "nearest_neighbor"
              else "align_corners"
          )
          z = relay.image.resize2d(
              x,
              size_var,
              None,
              layout,
              method,
              coordinate_transformation_mode=coord_trans,
          )
          params = {"size": np.array(size).astype("float32")}
  
          func = run_infer_type(relay.Function([x, size_var], z))
          func2 = run_opt_pass(
              run_opt_pass(func, transform.DynamicToStatic(), params),
              transform.InferType(),
          )
  
          zz = func2.body
          assert isinstance(zz, relay.Call)
          assert zz.op == relay.op.get("image.resize2d")
  
          x_data = np.random.uniform(low=-1, high=1, size=shape).astype(
              "float32"
          )
          ref_res = tvm.topi.testing.resize2d_python(
              x_data, (scale, scale), layout, method, coord_trans
          )
  
      for method in ["linear", "nearest_neighbor"]:
          for layout in ["NCHW", "NHWC"]:
              verify_resize((1, 4, 4, 4), 2, method, layout)
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.build_module import bind_params_by_name
  from tvm.relay.testing import run_infer_type, create_workload
  import tvm.topi.testing
  import tvm.testing
label_desc: Use image node_id 11 for calling a global function with example usage: test_dynamic_to_static_resize2d() without return types