MCPcopy Create free account
hub / github.com/apple/coremltools / ensure

Method ensure

deps/pybind11/include/pybind11/numpy.h:1097–1103  ·  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

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
1105protected:
1106 template <typename, typename>

Callers 2

test_intree_extensionsFunction · 0.80

Calls 1

ptrMethod · 0.80

Tested by 2

test_intree_extensionsFunction · 0.64