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

upd TensorImpl test according to new copy assignment operator for Tensor

parent e1cfb651
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,7 @@ using namespace Aidge; ...@@ -21,9 +21,7 @@ using namespace Aidge;
TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
SECTION("from const array") { SECTION("from const array") {
Tensor x; Tensor x;
x.setDataType(Aidge::DataType::Int32); x = Array3D<cpptype_t<DataType::Int32>,2,2,2>{
x.setBackend("opencv");
x = Array3D<int,2,2,2>{
{ {
{ {
{1, 2}, {1, 2},
...@@ -34,11 +32,10 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { ...@@ -34,11 +32,10 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
{7, 8} {7, 8}
} }
}}; }};
x.setBackend("opencv");
Tensor xCopy; Tensor xCopy;
xCopy.setDataType(Aidge::DataType::Int32); xCopy = Array3D<cpptype_t<DataType::Int32>,2,2,2>{
xCopy.setBackend("opencv");
xCopy = Array3D<int,2,2,2>{
{ {
{ {
{1, 2}, {1, 2},
...@@ -49,10 +46,9 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { ...@@ -49,10 +46,9 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
{7, 8} {7, 8}
} }
}}; }};
xCopy.setBackend("opencv");
Tensor xFloat; Tensor xFloat{Array3D<cpptype_t<DataType::Float32>,2,2,2>{
xFloat.setBackend("opencv");
xFloat = Array3D<float,2,2,2>{
{ {
{ {
{1., 2.}, {1., 2.},
...@@ -62,7 +58,8 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") { ...@@ -62,7 +58,8 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
{5., 6.}, {5., 6.},
{7., 8.} {7., 8.}
} }
}}; }}};
xFloat.setBackend("opencv");
SECTION("Tensor features") { SECTION("Tensor features") {
REQUIRE(x.nbDims() == 3); REQUIRE(x.nbDims() == 3);
......
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