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

Function read_small_vector

cpp/nd/impl/serialize.hpp:68–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67template <typename T>
68inline auto read_small_vector(std::istream& s, icm::small_vector<T>& v)
69{
70 nd::dtype t;
71 read_pod(s, t);
72 if (t != nd::dtype_enum_v<T>) {
73 throw nd::invalid_operation("Dtype mismatch");
74 }
75 std::size_t size = 0;
76 read_pod(s, size);
77 v.resize(size);
78 s.read(reinterpret_cast<char*>(v.data()), size * sizeof(T));
79}
80
81inline auto read_shape(std::istream& s, icm::shape& v)
82{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected