code: def test_complex_reduce(target, dev):
      in_shape = (2, 3)
      dtype = "float32"
      axis = 0
      keepdims = False
      A = te.placeholder(shape=in_shape, name="A", dtype=dtype)
      B = topi.sum(A, axis=axis, keepdims=keepdims)
      C = topi.add(B, B)
      D = topi.multiply(B, B)
      E = topi.add(C, D)
  
      with tvm.target.Target(target):
          s = tvm.topi.testing.get_reduce_schedule(target)(E)
      foo = tvm.build(s, [A, E], target, name="sum")
  
      in_npy = np.random.uniform(-1, 1, size=in_shape).astype(dtype)
      sum_npy = in_npy.sum(axis=axis, keepdims=keepdims)
      out_npy = sum_npy * 2 + sum_npy * sum_npy
  
      data_tvm = tvm.nd.array(in_npy, device=dev)
      out_tvm = tvm.nd.empty(
          shape=out_npy.shape, device=dev, dtype=dtype
      )
      foo(data_tvm, out_tvm)
      tvm.testing.assert_allclose(out_tvm.numpy(), out_npy, 1e-3, 1e-3)
  
file_path: tvm/tests/python/topi/test_topi_reduce.py
imports: import os
  import sys
  import numpy
  import pytest
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import te, topi, tir
label_desc: Use image node_id 5 for calling a global function with example usage: test_complex_reduce(target, dev) without return types