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

Method ensure

include/pybind11/numpy.h:1319–1325  ·  view source on GitHub ↗

Ensure that the argument is a NumPy array In case of an error, nullptr is returned and the Python error is cleared.

Source from the content-addressed store, hash-verified

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
1327protected:
1328 template <typename, typename>

Callers 2

test_intree_extensionsFunction · 0.80

Calls 1

ptrMethod · 0.80

Tested by 2

test_intree_extensionsFunction · 0.64