@tqchen 
Hi! What should I do next for this PR?
For the release of DLPack,
here are the implements of PyTorch and Cupy.
[PyTorch 
aten/src/ATen/DLConvertor.cpp#L170](https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/DLConvertor.cpp#L170)
```C++
Tensor fromDLPack(const DLManagedTensor* src) {
  Backend backend = getATenBackend(src->dl_tensor.ctx);
  ScalarType stype = toScalarType(src->dl_tensor.dtype);
  auto deleter = [src](void * self) {
    src->deleter(const_cast<DLManagedTensor*>(src));
  };
  return getType(backend, stype).tensorFromBlob(
      src->dl_tensor.data,
      IntList(src->dl_tensor.shape, src->dl_tensor.ndim),
      IntList(src->dl_tensor.strides, src->dl_tensor.ndim),
      deleter);
}
```

[CuPy 
cupy/core/dlpack.pyx#L231](https://github.com/cupy/cupy/blob/master/cupy/core/dlpack.pyx#L231)
```python
mem = DLPackMemory(dltensor)
mem_ptr = memory.MemoryPointer(mem, mem.dlm_tensor.dl_tensor.byte_offset)
cupy_array = ndarray(shape_vec, cp_dtype, mem_ptr)
```

Their NDArray both save dltensor.

So I add a new member `dlpack` for mx.nd.NDArray for store of dltensor.

[ Full content available at: 
https://github.com/apache/incubator-mxnet/pull/12047 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to