code: def test_tensor_scalar_mixed():
      # test te with tensor and scalar
      a = np.array(np.random.uniform(size=(10,)), "float32")
      b = np.array(np.random.uniform(size=(1))[0], "float32")
      c = np.array(np.random.uniform(size=(10,)), "float32")
  
      @tvm.register_func("tvm.test_tensor_scalar_scale")
      def my_scale(tensor, scalar, out):
          out_np = tensor.numpy() * scalar.numpy()
          tvm.nd.array(out_np).copyto(out)
  
      A = te.placeholder(a.shape, name="A")
      B = te.placeholder(b.shape, name="B")
      C = te.extern(
          a.shape,
          [A, B],
          lambda ins, outs: tvm.tir.call_packed(
              "tvm.test_tensor_scalar_scale", ins[0], ins[1], outs[0]
          ),
          name="C",
      )
      s = te.create_schedule(C.op)
      f = tvm.build(s, [A, B, C], "llvm")
  
      ta = tvm.nd.array(a)
      tb = tvm.nd.array(b)
      tc = tvm.nd.array(c)
      f(ta, tb, tc)
      tvm.testing.assert_allclose(a * b, tc.numpy())
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.topi.nn.pooling import pool2d
label_desc: Use image node_id 20 for calling a global function with example usage: test_tensor_scalar_mixed() without return types