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

Method with_data

cpp/nd/array.hpp:673–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671
672 template <typename F>
673 inline auto with_data(F f) const
674 {
675 ASSERT(has_data());
676 return switch_dtype(dtype(), [this, f]<typename T>() {
677 auto sp = data();
678 auto d = base::span_cast<const T>(sp);
679 return f.template operator()<T>(d);
680 });
681 }
682
683 template <typename F>
684 inline auto with_numeric_data(F f) const

Callers

nothing calls this directly

Calls 3

switch_dtypeFunction · 0.85
dtypeEnum · 0.70
dataFunction · 0.50

Tested by

no test coverage detected