From c91dba9a824609f4352108c2829864d7ff6febe4 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Tue, 3 Dec 2024 12:40:08 +0000 Subject: [PATCH] upd TensorImpl test according to new copy assignment operator for Tensor --- unit_tests/Test_TensorImpl.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/unit_tests/Test_TensorImpl.cpp b/unit_tests/Test_TensorImpl.cpp index 7ef7d5f..16e68bc 100644 --- a/unit_tests/Test_TensorImpl.cpp +++ b/unit_tests/Test_TensorImpl.cpp @@ -21,9 +21,7 @@ using namespace Aidge; TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { SECTION("from const array") { Tensor x; - x.setDataType(Aidge::DataType::Int32); - x.setBackend("opencv"); - x = Array3D<int,2,2,2>{ + x = Array3D<cpptype_t<DataType::Int32>,2,2,2>{ { { {1, 2}, @@ -34,11 +32,10 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { {7, 8} } }}; + x.setBackend("opencv"); Tensor xCopy; - xCopy.setDataType(Aidge::DataType::Int32); - xCopy.setBackend("opencv"); - xCopy = Array3D<int,2,2,2>{ + xCopy = Array3D<cpptype_t<DataType::Int32>,2,2,2>{ { { {1, 2}, @@ -49,10 +46,9 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { {7, 8} } }}; + xCopy.setBackend("opencv"); - Tensor xFloat; - xFloat.setBackend("opencv"); - xFloat = Array3D<float,2,2,2>{ + Tensor xFloat{Array3D<cpptype_t<DataType::Float32>,2,2,2>{ { { {1., 2.}, @@ -62,7 +58,8 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { {5., 6.}, {7., 8.} } - }}; + }}}; + xFloat.setBackend("opencv"); SECTION("Tensor features") { REQUIRE(x.nbDims() == 3); -- GitLab