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

Function ToPython

python/mod_cvcuda/nvcv/Tensor.cpp:351–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351static py::object ToPython(const nvcv::TensorData &tensorData, py::object owner)
352{
353 py::object out;
354
355 auto stridedData = tensorData.cast<nvcv::TensorDataStrided>();
356 if (!stridedData)
357 {
358 throw std::runtime_error("Only tensors with pitch-linear data can be exported");
359 }
360
361 DLPackTensor dlTensor(*stridedData);
362 return ExternalBuffer::Create(std::move(dlTensor), owner);
363}
364
365py::object Tensor::cuda() const
366{

Callers 1

cudaMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected