MCPcopy Create free account
hub / github.com/davisking/dlib / getstate

Function getstate

dlib/python/serialize_pickle.h:17–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16 template<typename T>
17 py::tuple getstate(const T& item)
18 {
19 using namespace dlib;
20 std::vector<char> buf;
21 buf.reserve(5000);
22 vectorstream sout(buf);
23 serialize(item, sout);
24 return py::make_tuple(py::handle(
25 PyBytes_FromStringAndSize(buf.size()?&buf[0]:0, buf.size())));
26 }
27
28 template<typename T>
29 T setstate(py::tuple state)

Callers

nothing calls this directly

Calls 5

make_tupleFunction · 0.85
serializeFunction · 0.50
handleFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected