Ensure that the argument is a NumPy array In case of an error, nullptr is returned and the Python error is cleared.
| 1095 | /// Ensure that the argument is a NumPy array |
| 1096 | /// In case of an error, nullptr is returned and the Python error is cleared. |
| 1097 | static array ensure(handle h, int ExtraFlags = 0) { |
| 1098 | auto result = reinterpret_steal<array>(raw_array(h.ptr(), ExtraFlags)); |
| 1099 | if (!result) { |
| 1100 | PyErr_Clear(); |
| 1101 | } |
| 1102 | return result; |
| 1103 | } |
| 1104 | |
| 1105 | protected: |
| 1106 | template <typename, typename> |