Skip to content
Snippets Groups Projects

v0.1.4

Merged Maxence Naud requested to merge dev into main
1 file
+ 7
10
Compare changes
  • Side-by-side
  • Inline
@@ -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);
Loading