| 349 | } |
| 350 | |
| 351 | static 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 | |
| 365 | py::object Tensor::cuda() const |
| 366 | { |