Skip to content
Snippets Groups Projects
Commit 8a2e68a4 authored by Olivier BICHLER's avatar Olivier BICHLER Committed by Maxence Naud
Browse files

Implement Tensor::zeros()

parent d8014139
No related branches found
No related tags found
1 merge request!17version 0.0.3
...@@ -94,6 +94,10 @@ public: ...@@ -94,6 +94,10 @@ public:
inline std::size_t scalarSize() const noexcept override final { return sizeof(T); } inline std::size_t scalarSize() const noexcept override final { return sizeof(T); }
void zeros() override final {
mData.setTo(Scalar::all(T(0)));
}
void copy(const void *src, NbElts_t length, NbElts_t offset = 0) override final { void copy(const void *src, NbElts_t length, NbElts_t offset = 0) override final {
const T* srcT = static_cast<const T *>(src); const T* srcT = static_cast<const T *>(src);
T* dstT = static_cast<T *>(rawPtr(offset)); T* dstT = static_cast<T *>(rawPtr(offset));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment