jermainewang commented on issue #13658: Converting MX array to DLPack crashes 
when MX array goes out-of-scope
URL: 
https://github.com/apache/incubator-mxnet/issues/13658#issuecomment-448084919
 
 
   @wkcn , try following steps:
   
   1. Use a ubuntu 16.04 image.
   2. Create file `t.py` with following codes:
     ```python
     import mxnet as mx
   import numpy as np
   import tvm
   
   def foo():
       x = mx.nd.array([0, 5], dtype='int64')
       dl = x.to_dlpack_for_read()
       return tvm.nd.from_dlpack(dl)
   
   for i in range(10):
       y = foo()
       y.asnumpy()
     ```
   3. Run it with `for i in {0..100}; do echo $i && python3 t.py || break ; 
done`
   
   I used a ubuntu docker image and could reproduce the error.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to