MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / ToDType

Function ToDType

python/common/PyUtil.cpp:111–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111py::dtype ToDType(const py::buffer_info &info)
112{
113 std::string fmt = ProcessBufferInfoFormat(info.format);
114
115 PyObject *ptr = nullptr;
116 if ((py::detail::npy_api::get().PyArray_DescrConverter_(py::str(fmt).ptr(), &ptr) == 0) || !ptr)
117 {
118 PyErr_Clear();
119 return py::dtype(info);
120 }
121 else
122 {
123 return py::dtype(fmt);
124 }
125}
126
127py::dtype ToDType(const std::string &fmt)
128{

Callers

nothing calls this directly

Calls 2

ProcessBufferInfoFormatFunction · 0.85
ptrMethod · 0.45

Tested by

no test coverage detected