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/01 02:44:26 UTC

[GitHub] [incubator-tvm] hewumars opened a new issue #5973: 1d vector dot product

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


   N = 512
   ctx = tvm.context("cpu")
   k = te.reduce_axis((0,N),'k')
   A0 = te.placeholder((N,),'uint16', name='A0')
   A1 = te.placeholder((N,),'uint16', name='A1')
   
   B = te.compute((1,), lambda k: te.sum(A0[k] * A1[k],axis=0), name='B')
   a0 = tvm.nd.array(np.ones(512).astype(A0.dtype), ctx)
   a1 = tvm.nd.array(np.ones(512).astype(A1.dtype), ctx)
   b = tvm.nd.array(np.zeros(1, dtype="int32"), ctx)
   func = tvm.build(s, [A0, A1, B], target=target, name='dot_product')
   func(a0,a1,b)
   print(b)    # result : [1] 
   print(np.sum(np.dot(np.ones(512),np.ones(512)),axis=0))   # result : 512.0
   
   where is te.compute wrong? 
   


----------------------------------------------------------------
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] hewumars closed issue #5973: 1d vector dot product

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


   


----------------------------------------------------------------
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