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

Method dtype

include/pybind11/numpy.h:840–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838 PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_)
839
840 explicit dtype(const buffer_info &info) {
841 dtype descr(_dtype_from_pep3118()(pybind11::str(info.format)));
842 // If info.itemsize == 0, use the value calculated from the format string
843 m_ptr = descr.strip_padding(info.itemsize != 0 ? info.itemsize : descr.itemsize())
844 .release()
845 .ptr();
846 }
847
848 explicit dtype(const pybind11::str &format) : dtype(from_args(format)) {}
849

Callers 15

test_constructorsFunction · 0.45
test_dtype_refcount_leakFunction · 0.45
simple_dtypeFunction · 0.45
packed_dtypeFunction · 0.45
simple_dtype_fmtFunction · 0.45
packed_dtype_fmtFunction · 0.45
partial_ld_offsetFunction · 0.45
partial_dtype_fmtFunction · 0.45
partial_nested_fmtFunction · 0.45
test_format_descriptorsFunction · 0.45

Calls 8

strClass · 0.85
moveFunction · 0.85
int_Class · 0.85
getFunction · 0.85
ptrMethod · 0.80
releaseMethod · 0.80
strip_paddingMethod · 0.80
itemsizeMethod · 0.45

Tested by 15

test_constructorsFunction · 0.36
test_dtype_refcount_leakFunction · 0.36
simple_dtypeFunction · 0.36
packed_dtypeFunction · 0.36
simple_dtype_fmtFunction · 0.36
packed_dtype_fmtFunction · 0.36
partial_ld_offsetFunction · 0.36
partial_dtype_fmtFunction · 0.36
partial_nested_fmtFunction · 0.36
test_format_descriptorsFunction · 0.36