summaryrefslogtreecommitdiff
path: root/modules/codec/c++
diff options
context:
space:
mode:
Diffstat (limited to 'modules/codec/c++')
-rw-r--r--modules/codec/c++/data_math.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/codec/c++/data_math.hpp b/modules/codec/c++/data_math.hpp
index b5491eb..5791f00 100644
--- a/modules/codec/c++/data_math.hpp
+++ b/modules/codec/c++/data_math.hpp
@@ -104,6 +104,17 @@ public:
return c;
}
+
+ data<schema::Tensor<Inner, Dims...>, encode::Native> operator-(const data<schema::Tensor<Inner, Dims...>, encode::Native>& rhs) {
+ data<schema::Tensor<Inner, Dims...>, encode::Native> c;
+
+ rank_iterator<Dims...>::in_fixed_bounds([&](const data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>, encode::Native>& index) -> error_or<void>{
+ c.at(index) = at(index) - rhs.at(index);
+ return make_void();
+ });
+
+ return c;
+ }
};
}