Skip to content
Snippets Groups Projects
Commit 75d547cd authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'ui_parameters' into 'dev'

UI parameters

See merge request !16
parents 1062621f b146d610
No related branches found
No related tags found
2 merge requests!17version 0.0.3,!16UI parameters
Pipeline #49603 passed
...@@ -19,7 +19,7 @@ class test_tensor(unittest.TestCase): ...@@ -19,7 +19,7 @@ class test_tensor(unittest.TestCase):
# np_array = np.arange(9).reshape(1,1,3,3) # np_array = np.arange(9).reshape(1,1,3,3)
# # Numpy -> Tensor # # Numpy -> Tensor
# t = aidge_core.Tensor(np_array) # t = aidge_core.Tensor(np_array)
# self.assertEqual(t.dtype(), aidge_core.DataType.Int32) # self.assertEqual(t.dtype(), aidge_core.dtype.int32)
# for i_t, i_n in zip(t, np_array.flatten()): # for i_t, i_n in zip(t, np_array.flatten()):
# self.assertTrue(i_t == i_n) # self.assertTrue(i_t == i_n)
# for i,j in zip(t.dims(), np_array.shape): # for i,j in zip(t.dims(), np_array.shape):
...@@ -41,7 +41,7 @@ class test_tensor(unittest.TestCase): ...@@ -41,7 +41,7 @@ class test_tensor(unittest.TestCase):
# np_array = np.random.rand(1, 1, 3, 3).astype(np.float32) # np_array = np.random.rand(1, 1, 3, 3).astype(np.float32)
# # Numpy -> Tensor # # Numpy -> Tensor
# t = aidge_core.Tensor(np_array) # t = aidge_core.Tensor(np_array)
# self.assertEqual(t.dtype(), aidge_core.DataType.Float32) # self.assertEqual(t.dtype(), aidge_core.dtype.float32)
# for i_t, i_n in zip(t, np_array.flatten()): # for i_t, i_n in zip(t, np_array.flatten()):
# self.assertTrue(i_t == i_n) # TODO : May need to change this to a difference # self.assertTrue(i_t == i_n) # TODO : May need to change this to a difference
# for i,j in zip(t.dims(), np_array.shape): # for i,j in zip(t.dims(), np_array.shape):
......
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
virtual void setCvMat(const cv::Mat& mat ) = 0; virtual void setCvMat(const cv::Mat& mat ) = 0;
}; };
template <class T> template <class T>
class TensorImpl_opencv : public TensorImpl, public TensorImpl_opencv_ { class TensorImpl_opencv : public TensorImpl, public TensorImpl_opencv_ {
private: private:
// Stores the cv::Mat // Stores the cv::Mat
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
static constexpr const char *Backend = "opencv"; static constexpr const char *Backend = "opencv";
TensorImpl_opencv() = delete; TensorImpl_opencv() = delete;
TensorImpl_opencv(DeviceIdx_t device, std::vector<DimSize_t> dims) TensorImpl_opencv(DeviceIdx_t device, std::vector<DimSize_t> dims)
: TensorImpl(Backend, device, dims) : TensorImpl(Backend, device, dims)
{ {
mDims = dims; mDims = dims;
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
if (length == 0) { if (length == 0) {
return; return;
} }
T* dstT = static_cast<T *>(rawPtr(offset)); T* dstT = static_cast<T *>(rawPtr(offset));
AIDGE_ASSERT(length <= (mData.total() * mData.channels()) || length <= mNbElts, "TensorImpl_opencv<{}>::copyCast(): copy length ({}) is above capacity ({})", typeid(T).name(), length, mNbElts); AIDGE_ASSERT(length <= (mData.total() * mData.channels()) || length <= mNbElts, "TensorImpl_opencv<{}>::copyCast(): copy length ({}) is above capacity ({})", typeid(T).name(), length, mNbElts);
switch (srcDt) switch (srcDt)
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
}; };
void setCvMat(const cv::Mat& mat) override {mData=mat;} void setCvMat(const cv::Mat& mat) override {mData=mat;}
virtual ~TensorImpl_opencv() = default; virtual ~TensorImpl_opencv() = default;
......
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