code: def test_broadcast_binary_op(lhs_shape, rhs_shape, typ="add"):
      global TASK
      TASK = (
          "bcast_binary_"
          + typ
          + "_lhs"
          + "_".join([str(ele) for ele in lhs_shape])
          + "rhs"
          + "_".join([str(ele) for ele in rhs_shape])
      )
      A = te.placeholder(shape=lhs_shape, name="A")
      B = te.placeholder(shape=rhs_shape, name="B")
      if typ == "add":
          C = topi.broadcast_add(A, B)
      elif typ == "sub":
          C = topi.broadcast_sub(A, B)
      elif typ == "div":
          C = topi.broadcast_div(A, B)
      elif typ == "mul":
          C = topi.broadcast_mul(A, B)
      elif typ == "maximum":
          C = topi.broadcast_maximum(A, B)
      elif typ == "minimum":
          C = topi.broadcast_minimum(A, B)
      else:
          raise NotImplementedError
      s = topi.cuda.schedule_broadcast(C)
      fcuda = tvm.build(
          s, [A, B, C], "cuda", name="broadcast_binary" + "_" + typ
      )
  
      lhs_npy = np.random.uniform(size=lhs_shape).astype(A.dtype)
      rhs_npy = np.random.uniform(size=rhs_shape).astype(A.dtype)
      if typ == "add":
          out_npy = lhs_npy + rhs_npy
      elif typ == "sub":
          out_npy = lhs_npy - rhs_npy
      elif typ == "div":
          rhs_npy = np.abs(rhs_npy) + 0.001
          out_npy = lhs_npy / rhs_npy
      elif typ == "mul":
          out_npy = lhs_npy * rhs_npy
      elif typ == "maximum":
          out_npy = np.maximum(lhs_npy, rhs_npy)
      elif typ == "minimum":
          out_npy = np.minimum(lhs_npy, rhs_npy)
      lhs_nd = tvm.nd.array(lhs_npy, tvm.cuda())
      rhs_nd = tvm.nd.array(rhs_npy, tvm.cuda())
      out_nd = tvm.nd.array(
          np.empty(out_npy.shape).astype(B.dtype), tvm.cuda()
      )
      for _ in range(2):
          fcuda(lhs_nd, rhs_nd, out_nd)
      tvm.testing.assert_allclose(out_nd.numpy(), out_npy)
  
file_path: tvm/apps/topi_recipe/broadcast/test_broadcast_map.py
imports: import os
  import numpy
  import tvm
  from tvm import te, topi
  from tvm.contrib import nvcc
label_desc: Use image node_id 5 for calling a global function with example usage: test_broadcast_binary_op(lhs_shape, rhs_shape, typ) without return types