MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / Export

Method Export

python/mod_cvcuda/nvcv/ExternalBuffer.cpp:381–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381void ExternalBuffer::Export(py::module &m)
382{
383 py::class_<ExternalBuffer, std::shared_ptr<ExternalBuffer>>(m, "ExternalBuffer", py::dynamic_attr())
384 .def_property_readonly("shape", &ExternalBuffer::shape, "Get the shape of the buffer as an array")
385 .def_property_readonly("strides", &ExternalBuffer::strides, "Get the strides of the buffer")
386 .def_property_readonly("dtype", &ExternalBuffer::dtype, "Get the data type of the buffer")
387 .def("__dlpack__", &ExternalBuffer::dlpack, "stream"_a=1, "Export the buffer as a DLPack tensor")
388 .def("__dlpack_device__", &ExternalBuffer::dlpackDevice, "Get the device associated with the buffer");
389}
390
391} // namespace nvcvpy::priv
392

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected