| 379 | } |
| 380 | |
| 381 | void 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 |
nothing calls this directly
no outgoing calls
no test coverage detected