| 224 | |
| 225 | template <typename Backend> |
| 226 | py::list TensorListToDLPackView(TensorList<Backend> &tensors) { |
| 227 | py::list result; |
| 228 | auto dl_tensors = GetDLTensorListView(tensors); |
| 229 | for (DLMTensorPtr &dl_tensor : dl_tensors) { |
| 230 | result.append(DLTensorToCapsule(std::move(dl_tensor))); |
| 231 | } |
| 232 | return result; |
| 233 | } |
| 234 | |
| 235 | static DLManagedTensor* DLMTensorRawPtrFromCapsule(py::capsule &capsule, bool consume = true) { |
| 236 | DALI_ENFORCE(std::string(capsule.name()) == DLTENSOR_NAME, |
no test coverage detected