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

Method get

cpp/nd/impl/full_buffer_array.hpp:128–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 }
127
128 nd::array get(int64_t index) const
129 {
130 icm::string_map<nd::array> key2arr;
131 for (auto i = 0; i < header_->keys_.size(); ++i) {
132 const auto& [key, dt] = header_->keys_[i];
133 const auto start = header_->offsets_[i] + header_->data_offset_;
134 const auto end = header_->offsets_[i + 1] + header_->data_offset_;
135 auto buffer = data_.chunk(start, end);
136 key2arr[key] = header_->get(buffer, dt, i);
137 }
138 if (header_->version_ < 2U) {
139 return nd::impl::dict_array(std::move(key2arr), 1).get(index);
140 } else {
141 return nd::impl::dict_array(std::move(key2arr), header_->dynamic_rows_[index]).get(index);
142 }
143 }
144
145 icm::shape shape() const noexcept
146 {

Callers

nothing calls this directly

Calls 4

dict_arrayClass · 0.85
chunkMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected