| 156 | |
| 157 | template <typename T, int size> |
| 158 | Eigen::DSizes<T, size> get_shape_for_array(const array &arr) { |
| 159 | Eigen::DSizes<T, size> result; |
| 160 | const T *shape = arr.shape(); |
| 161 | for (size_t i = 0; i < size; i++) { |
| 162 | result[i] = shape[i]; |
| 163 | } |
| 164 | |
| 165 | return result; |
| 166 | } |
| 167 | |
| 168 | PYBIND11_WARNING_POP |
| 169 |