| 415 | } |
| 416 | |
| 417 | inline void buffer_from_numpy(Buffer& self, pybind11::ndarray<pybind11::numpy> data) |
| 418 | { |
| 419 | FALCOR_CHECK(isNdarrayContiguous(data), "numpy array is not contiguous"); |
| 420 | |
| 421 | size_t bufferSize = self.getSize(); |
| 422 | size_t dataSize = getNdarrayByteSize(data); |
| 423 | FALCOR_CHECK(dataSize <= bufferSize, "numpy array is larger than the buffer ({} > {})", dataSize, bufferSize); |
| 424 | |
| 425 | self.setBlob(data.data(), 0, dataSize); |
| 426 | } |
| 427 | |
| 428 | #if FALCOR_HAS_CUDA |
| 429 | inline pybind11::ndarray<pybind11::pytorch> buffer_to_torch(const Buffer& self, std::vector<size_t> shape, DataType dtype) |
nothing calls this directly
no test coverage detected