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 2022/02/28 22:24:54 UTC

[GitHub] [tvm] AndrewZhaoLuo opened a new pull request #10418: Fix shape func for strided slice

AndrewZhaoLuo opened a new pull request #10418:
URL: https://github.com/apache/tvm/pull/10418


   Small mistake:
   
   Previously the before would not return the correct shape:
   ```
   import numpy as np
   import tvm
   from tvm import relay
   from tvm.relay import vm
   from tvm.runtime import vm as vm_rt
   
   input = relay.var("input", shape=[relay.Any(), 3])
   
   result = relay.strided_slice(
       input,
       begin=[1],
       end=[2],
       strides=[1],
       axes=[1],
   )
   # result = relay.squeeze(result, axis=[1])
   
   mod = tvm.IRModule.from_expr(result)
   dev = tvm.device("llvm", 0)
   host = tvm.cpu()
   exe = vm.compile(mod, "llvm", params={})
   relay_vm = vm_rt.VirtualMachine(exe, dev)
   
   # size=[1,3], size=[0, 3] fails
   result = relay_vm.run(np.random.uniform(0, 1, size=[1, 3]).astype("float32"))
   
   print(result.numpy().shape)
   ```
   
   Now it does


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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mbrookhart merged pull request #10418: [Relay] Fix shape func for strided slice

Posted by GitBox <gi...@apache.org>.
mbrookhart merged pull request #10418:
URL: https://github.com/apache/tvm/pull/10418


   


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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mbrookhart commented on pull request #10418: [Relay] Fix shape func for strided slice

Posted by GitBox <gi...@apache.org>.
mbrookhart commented on pull request #10418:
URL: https://github.com/apache/tvm/pull/10418#issuecomment-1057271147


   Thanks Andrew


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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org