From 7c87a79d712a4b15c8253c2b5e71fef377f95789 Mon Sep 17 00:00:00 2001
From: Wissam Boussella <wissam.boussella@cea.fr>
Date: Thu, 20 Feb 2025 16:18:10 +0100
Subject: [PATCH] remove redendency  in setDataFormat deleting old tests

---
 include/aidge/data/Tensor.hpp        |  6 ---
 unit_tests/operator/Test_Conv_Op.cpp | 61 ----------------------------
 2 files changed, 67 deletions(-)

diff --git a/include/aidge/data/Tensor.hpp b/include/aidge/data/Tensor.hpp
index 5c184e961..785caaa0e 100644
--- a/include/aidge/data/Tensor.hpp
+++ b/include/aidge/data/Tensor.hpp
@@ -467,12 +467,6 @@ public:
             return;
         }
     
-        if ((df == DataFormat::Default && dataFormat() == DataFormat::Default) || 
-            (df == DataFormat::NCHW && dataFormat() == DataFormat::NCHW)) {
-            mDataFormat = df;
-            return;
-        }
-    
         const auto transpose = getDataFormatTranspose(dataFormat(), df);
         
         if (mImpl) {
diff --git a/unit_tests/operator/Test_Conv_Op.cpp b/unit_tests/operator/Test_Conv_Op.cpp
index 002e52522..de33ddd5a 100644
--- a/unit_tests/operator/Test_Conv_Op.cpp
+++ b/unit_tests/operator/Test_Conv_Op.cpp
@@ -101,67 +101,6 @@ TEST_CASE("[core/operator] Conv_Op(ForwardDims) ", "[Operator][ForwardDims][Conv
         REQUIRE(conv1.forwardDims());
         REQUIRE(conv1.getOutput(0)->dims() == expectedOutputDims);
     }
-    
-
-    // SECTION("I:NCHW O:NHWC W:NCHW") {
-    //     std::shared_ptr<Tensor> input = std::make_shared<Tensor>(std::vector<std::size_t>({16,3,224,450}));
-    //     std::shared_ptr<Tensor> weight = std::make_shared<Tensor>(std::vector<std::size_t>({4,3,3,4}));
-
-    //     const std::vector<std::size_t> expectedOutputDims({16,222,447,4});
-    //     auto conv1 = Conv_Op<2>(std::array<size_t, 2>{3, 4});
-
-    //     // Set DataFormat
-    //     conv1.getOutput(0)->setDataFormat(Aidge::DataFormat::NHWC);
-    //     input->setDataFormat(Aidge::DataFormat::NCHW);
-    //     weight->setDataFormat(Aidge::DataFormat::NCHW);
-
-    //     // Set inputs
-    //     conv1.setInput(1, weight);
-    //     conv1.setInput(0, input);
-
-    //     REQUIRE(conv1.forwardDims());
-    //     REQUIRE(conv1.getOutput(0)->dims() == expectedOutputDims);
-    // }
-
-    // SECTION("I:NHWC O:NCHW W:NHWC") {
-    //     std::shared_ptr<Tensor> input = std::make_shared<Tensor>(std::vector<std::size_t>({16,224,450,3}));
-    //     std::shared_ptr<Tensor> weight = std::make_shared<Tensor>(std::vector<std::size_t>({4,4,3,3})); // H, W, In_ch, Out_ch
-
-    //     const std::vector<std::size_t> expectedOutputDims({16,4,222,447});
-    //     auto conv1 = Conv_Op<2>(std::array<size_t, 2>{3, 4});
-
-    //     // Set DataFormat
-    //     conv1.getOutput(0)->setDataFormat(Aidge::DataFormat::NCHW);
-    //     input->setDataFormat(Aidge::DataFormat::NHWC);
-    //     weight->setDataFormat(Aidge::DataFormat::NHWC);
-
-    //     // Set inputs
-    //     conv1.setInput(1, weight);
-    //     conv1.setInput(0, input);
-
-    //     REQUIRE(conv1.forwardDims());
-    //     REQUIRE(conv1.getOutput(0)->dims() == expectedOutputDims);
-    // }
-
-    // SECTION("I:NHWC O:NHWC W:NCHW") {
-    //     std::shared_ptr<Tensor> input = std::make_shared<Tensor>(std::vector<std::size_t>({16,224,450,3}));
-    //     std::shared_ptr<Tensor> weight = std::make_shared<Tensor>(std::vector<std::size_t>({4,3,3,4})); // Out_ch, In_ch, H, W
-
-    //     const std::vector<std::size_t> expectedOutputDims({16,222,447,4});
-    //     auto conv1 = Conv_Op<2>(std::array<size_t, 2>{3, 4});
-
-    //     // Set DataFormat
-    //     conv1.getOutput(0)->setDataFormat(Aidge::DataFormat::NHWC);
-    //     input->setDataFormat(Aidge::DataFormat::NHWC);
-    //     weight->setDataFormat(Aidge::DataFormat::NCHW);
-
-    //     // Set inputs
-    //     conv1.setInput(1, weight);
-    //     conv1.setInput(0, input);
-
-    //     REQUIRE(conv1.forwardDims());
-    //     REQUIRE(conv1.getOutput(0)->dims() == expectedOutputDims);
-    // }
 
 }
 
-- 
GitLab