You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/08 07:44:25 UTC

[GitHub] [incubator-tvm] ZihengJiang opened a new issue #6015: [DSL/TE] Scalar support for `te.extern`

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:
users@infra.apache.org



[GitHub] [incubator-tvm] eric-haibin-lin commented on issue #6015: [DSL/TE] Scalar support for `te.extern`

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on issue #6015:
URL: https://github.com/apache/incubator-tvm/issues/6015#issuecomment-659551366


   I'll take a stab


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] ZihengJiang closed issue #6015: [DSL/TE] Scalar support for `te.extern`

Posted by GitBox <gi...@apache.org>.
ZihengJiang closed issue #6015:
URL: https://github.com/apache/incubator-tvm/issues/6015


   


----------------------------------------------------------------
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:
users@infra.apache.org