Ensure that the argument is a NumPy array In case of an error, nullptr is returned and the Python error is cleared.
| 1317 | /// Ensure that the argument is a NumPy array |
| 1318 | /// In case of an error, nullptr is returned and the Python error is cleared. |
| 1319 | static array ensure(handle h, int ExtraFlags = 0) { |
| 1320 | auto result = reinterpret_steal<array>(raw_array(h.ptr(), ExtraFlags)); |
| 1321 | if (!result) { |
| 1322 | PyErr_Clear(); |
| 1323 | } |
| 1324 | return result; |
| 1325 | } |
| 1326 | |
| 1327 | protected: |
| 1328 | template <typename, typename> |