ZihengJiang opened a new issue #6015:
URL: https://github.com/apache/incubator-tvm/issues/6015


   We have scalar support in `te.compute` now. But for `te.extern`, tvm will 
raise error for scalar input. It would be great that we can have consistent 
behavior.
   
   Sample code:
   ```
   import tvm
   from tvm import te
   import numpy as np
   
   a = np.array(1.0, 'float32')
   b = np.array(0.0, 'float32')
   
   @tvm.register_func("tvm.copy")
   def mycopy(x, y):
       x.copyto(y)
   
   A = te.placeholder(a.shape, name='A')
   B = te.extern(a.shape, [A],
                 lambda ins, outs: tvm.tir.call_packed(
                 "tvm.copy", ins[0], outs[0]), name="B")
   
   s = te.create_schedule(B.op)
   f = tvm.build(s, [A, B], 'llvm')
   
   ta = tvm.nd.array(a)
   tb = tvm.nd.array(b)
   f(ta, tb)
   print(tb)
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to