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

Merge branch 'fix_tensor-backend-with-copy' into 'dev'

Fix tensor backend with copy

See merge request !22
parents a219640d 2f19d4ea
No related branches found
No related tags found
1 merge request!22Fix tensor backend with copy
Pipeline #61032 passed
...@@ -3,7 +3,7 @@ Include(FetchContent) ...@@ -3,7 +3,7 @@ Include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
Catch2 Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1 # or a later release GIT_TAG v3.7.1 # or a later release
) )
FetchContent_MakeAvailable(Catch2) FetchContent_MakeAvailable(Catch2)
......
...@@ -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