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

Method end

cpp/nd/array.hpp:261–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 }
260
261 iterator end() const override
262 {
263 if constexpr (impl::has_data_member_function_v<I> && !impl::is_scalar_v<I> &&
264 !impl::has_is_none_member_variable_v<I>) {
265 auto sh = shape();
266 auto subvolume = std::accumulate(sh.begin() + 1, sh.end(), 1L, std::multiplies<int64_t>()) *
267 nd::dtype_bytes(impl_.dtype());
268 auto d = std::span<const uint8_t>(impl_.data().data() + impl_.data().size(), subvolume);
269 return iterator(data_iterator(impl_.owner(), d, icm::shape(sh.begin() + 1, sh.end()), impl_.dtype()));
270 } else if constexpr (impl::has_end_member_function_v<I>) {
271 return iterator(impl_.end());
272 } else {
273 throw invalid_operation("end() method is not implemented for this array.");
274 }
275 }
276
277 array get(int64_t index) const override;
278

Callers

nothing calls this directly

Calls 10

shapeClass · 0.85
dtype_bytesFunction · 0.85
data_iteratorClass · 0.85
iteratorClass · 0.70
invalid_operationClass · 0.70
beginMethod · 0.45
endMethod · 0.45
dtypeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected