| 298 | } |
| 299 | |
| 300 | static py::object ToPython(const nvcv::ArrayData &arrayData, py::object owner) |
| 301 | { |
| 302 | py::object out; |
| 303 | |
| 304 | auto data = arrayData.cast<nvcv::ArrayData>(); |
| 305 | if (!data) |
| 306 | { |
| 307 | throw std::runtime_error("Only tensors with pitch-linear data can be exported"); |
| 308 | } |
| 309 | |
| 310 | DLPackTensor dlTensor(*data); |
| 311 | return ExternalBuffer::Create(std::move(dlTensor), owner); |
| 312 | } |
| 313 | |
| 314 | py::object Array::cuda() const |
| 315 | { |