Skip to content
Snippets Groups Projects
Commit 1062621f authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Merge branch 'tensorzeros' into 'dev'

Implement Tensor::zeros()

See merge request !15
parents 4d5f92c8 12e0d2c5
No related branches found
No related tags found
2 merge requests!17version 0.0.3,!15Implement Tensor::zeros()
Pipeline #47939 passed
...@@ -86,6 +86,10 @@ public: ...@@ -86,6 +86,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(cv::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