MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / buffer_from_numpy

Function buffer_from_numpy

Source/Falcor/Core/API/Buffer.cpp:417–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417inline 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
429inline pybind11::ndarray<pybind11::pytorch> buffer_to_torch(const Buffer& self, std::vector<size_t> shape, DataType dtype)

Callers

nothing calls this directly

Calls 5

isNdarrayContiguousFunction · 0.85
getNdarrayByteSizeFunction · 0.85
getSizeMethod · 0.45
setBlobMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected