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

Method get

cpp/nd/impl/sliced_array.hpp:257–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 nd::array get(int64_t index) const
258 {
259 if (!needs_resize_) {
260 return a_[index];
261 }
262 auto& s = slices_.front();
263 auto ii = index * s.step + s.offset;
264
265 if (a_.shape().size() > 1) {
266 return nd::array(
267 sliced_array(a_[ii], {slices_.begin() + 1, slices_.end()}, {shape_.begin() + 1, shape_.end()}));
268 }
269 return a_[ii];
270 }
271
272 nd::array eval() const
273 {

Callers

nothing calls this directly

Calls 7

sliced_arrayClass · 0.85
arrayClass · 0.70
frontMethod · 0.45
sizeMethod · 0.45
shapeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected