MCPcopy Create free account
hub / github.com/NVIDIA/DALI / DLTensorToCapsule

Function DLTensorToCapsule

dali/util/pybind.h:214–217  ·  view source on GitHub ↗

Steal a DLPack Tensor from the passed pointer and wrap it into Python capsule.

Source from the content-addressed store, hash-verified

212
213// Steal a DLPack Tensor from the passed pointer and wrap it into Python capsule.
214static py::capsule DLTensorToCapsule(DLMTensorPtr dl_tensor) {
215 auto caps = py::capsule(dl_tensor.release(), DLTENSOR_NAME, &DLTensorCapsuleDestructor);
216 return caps;
217}
218
219template <typename Backend>
220py::capsule TensorToDLPackView(SampleView<Backend> tensor, bool pinned, int device_id) {

Callers 4

ToDLPackFunction · 0.85
PYBIND11_MODULEFunction · 0.85
TensorToDLPackViewFunction · 0.85
TensorListToDLPackViewFunction · 0.85

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected