| 804 | } |
| 805 | |
| 806 | PyObject* tensor_to_dlpack(PyObject* tensor) { |
| 807 | TensorWrapper* wrapper = TensorWrapper::try_cast(tensor); |
| 808 | DLManagedTensor* dlMTensor = to_dlpack(wrapper->m_tensor->data()); |
| 809 | return PyCapsule_New(dlMTensor, "dltensor", dlpack_capsule_destructor); |
| 810 | } |
| 811 | |
| 812 | PyObject* tensor_from_dlpack(PyObject* data, PyObject* stream) { |
| 813 | DLManagedTensor* dlMTensor = |
no test coverage detected