diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-07 13:52:57 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-07 13:52:57 +0200 |
commit | b3cef3181140131dbba8f702b977b9f214537c14 (patch) | |
tree | 4ff8eb4f85e500cbfce6fa3fdd20add82d4daf8c /modules | |
parent | 03c56bcc83c8984165208a3826fb06f68109d1ac (diff) |
Changed to fixed array, because I don't want to allocate heaps all the
time :(
Diffstat (limited to 'modules')
-rw-r--r-- | modules/codec/c++/data_math.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/codec/c++/data_math.hpp b/modules/codec/c++/data_math.hpp index 5791f00..efdca7d 100644 --- a/modules/codec/c++/data_math.hpp +++ b/modules/codec/c++/data_math.hpp @@ -70,13 +70,18 @@ template<typename Inner, uint64_t... Dims> class data<schema::Tensor<Inner, Dims...>, encode::Native> { public: using Schema = schema::Tensor<Inner, Dims...>; + static constexpr uint64_t Rank = sizeof...(Dims); private: - data<schema::Array<Inner,Schema::Rank>, encode::Native> values_; + data<schema::FixedArray<Inner, Dims...>, encode::Native> values_; + //data<schema::Array<Inner,Schema::Rank>, encode::Native> values_; public: + /* data(): values_{data<schema::FixedArray<schema::UInt64,sizeof...(Dims)>>{{data<schema::UInt64, encode::Native>{Dims}...}}} {} + */ + data() = default; data<Inner, encode::Native>& at(const data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>, encode::Native>& index){ return values_.at(index); |