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

Method normalized_num

include/pybind11/numpy.h:940–946  ·  view source on GitHub ↗

Type number of dtype, normalized to match the return value of `num_of` for equivalent types. This function can be used to write switch statements that correctly handle equivalent types with different type numbers.

Source from the content-addressed store, hash-verified

938 /// types. This function can be used to write switch statements that correctly handle
939 /// equivalent types with different type numbers.
940 int normalized_num() const {
941 int value = num();
942 if (value >= 0 && value <= detail::npy_api::NPY_VOID_) {
943 return detail::normalized_dtype_num[value];
944 }
945 return value;
946 }
947
948 /// Single character for byteorder
949 char byteorder() const { return detail::array_descriptor_proxy(m_ptr)->byteorder; }

Callers 1

TEST_SUBMODULEFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_SUBMODULEFunction · 0.64