MCPcopy Create free account
hub / github.com/activeloopai/deeplake / read_vector

Function read_vector

cpp/nd/impl/serialize.hpp:39–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38template <typename F>
39inline auto read_vector(std::istream& s, F f)
40{
41 nd::dtype t;
42 read_pod(s, t);
43 std::size_t size = 0;
44 read_pod(s, size);
45 return nd::switch_dtype(t, [&s, size, f]<typename T>() mutable {
46 icm::vector<T> r;
47 r.resize(size);
48 s.read(reinterpret_cast<char*>(r.data()), size * sizeof(T));
49 return f(std::move(r));
50 });
51}
52
53template <typename T>
54inline auto read_vector(std::istream& s, std::vector<T>& v)

Callers

nothing calls this directly

Calls 7

read_podFunction · 0.85
switch_dtypeFunction · 0.85
fFunction · 0.85
invalid_operationClass · 0.50
resizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected