code: def test_collapse_sum_like(executor_kind):
      shape = (3, 4, 5, 6)
      shape_like = (4, 5, 6)
      dtype = "float32"
      x = relay.Var("x", relay.ty.TensorType(shape, dtype))
      y = relay.Var("y", relay.ty.TensorType(shape_like, dtype))
      z = relay.collapse_sum_like(x, y)
      zz = run_infer_type(z)
      assert zz.checked_type == relay.ty.TensorType(shape_like, dtype)
  
      func = relay.Function([x, y], z)
      x = np.random.uniform(size=shape).astype(dtype)
      y = np.random.uniform(size=shape_like).astype(dtype)
      ref_res = np.sum(x, 0)
      for target, dev in tvm.testing.enabled_targets():
          op_res = relay.create_executor(
              executor_kind, device=dev, target=target
          ).evaluate(func)(x, y)
          tvm.testing.assert_allclose(
              op_res.numpy(), ref_res, rtol=1e-5
          )
  
imports: import sys
  import pytest
  import numpy
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import relay, te, topi
  from tvm.relay import transform
  from tvm.relay.testing import run_infer_type
label_desc: Use image node_id 4 for calling a global function with example usage: test_collapse_sum_like(executor_kind) without return types