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

Function isNdarrayContiguous

Source/Falcor/Core/API/PythonHelpers.h:61–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60template<typename... Args>
61size_t isNdarrayContiguous(const pybind11::ndarray<Args...>& array)
62{
63 if (array.ndim() == 0)
64 return false;
65 size_t prod = 1;
66 for (size_t i = array.ndim() - 1;;)
67 {
68 if (array.stride(i) != prod)
69 return false;
70 prod *= array.shape(i);
71 if (i == 0)
72 break;
73 --i;
74 }
75 return true;
76}
77
78pybind11::dlpack::dtype dataTypeToDtype(DataType type);
79std::optional<pybind11::dlpack::dtype> resourceFormatToDtype(ResourceFormat format);

Callers 4

buffer_from_numpyFunction · 0.85
buffer_from_torchFunction · 0.85
buffer_copy_to_torchFunction · 0.85
texture_from_numpyFunction · 0.85

Calls 3

ndimMethod · 0.80
strideMethod · 0.80
shapeMethod · 0.80

Tested by

no test coverage detected