MCPcopy Create free account
hub / github.com/pybind/pybind11 / multi_array_iterator

Method multi_array_iterator

include/pybind11/numpy.h:1907–1919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1905 using container_type = std::vector<ssize_t>;
1906
1907 multi_array_iterator(const std::array<buffer_info, N> &buffers, const container_type &shape)
1908 : m_shape(shape.size()), m_index(shape.size(), 0), m_common_iterator() {
1909
1910 // Manual copy to avoid conversion warning if using std::copy
1911 for (size_t i = 0; i < shape.size(); ++i) {
1912 m_shape[i] = shape[i];
1913 }
1914
1915 container_type strides(shape.size());
1916 for (size_t i = 0; i < N; ++i) {
1917 init_common_iterator(buffers[i], shape, m_common_iterator[i], strides);
1918 }
1919 }
1920
1921 multi_array_iterator &operator++() {
1922 for (size_t j = m_index.size(); j != 0; --j) {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected