From cd3da81c76dfd7c0102315c364a5dafa1139f0b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20KUBLER?= <gregoire.kubler@proton.me>
Date: Thu, 27 Feb 2025 16:13:34 +0000
Subject: [PATCH] feat : [Conv] added check to ensure dilation & stride
 attributes values are strictly positive

---
 src/operator/Conv.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/operator/Conv.cpp b/src/operator/Conv.cpp
index 3abd144f8..42c47cb81 100644
--- a/src/operator/Conv.cpp
+++ b/src/operator/Conv.cpp
@@ -240,15 +240,15 @@ std::shared_ptr<Aidge::Node> Aidge::Conv(
     AIDGE_ASSERT(DIM<=MaxDim,"{}: Too many kernel dimensions required, maximum allowed : {} ", Conv_Op<DIM>::Type, MaxDim);
     AIDGE_ASSERT(!std::any_of(dilationDims.cbegin(),
                               dilationDims.cend(),
-                              [](DimSize_t val) { return val == 0; }),
-                 "Conv : at least of of the dilation dimension is 0, expecting "
+                              [](DimSize_t val) { return val <= 0; }),
+                 "Conv : at least of of the dilation dimension is <= 0, expecting "
                  "strictly positive values. Got {}",
                  Conv_Op<DIM>::Type,
                  dilationDims);
     AIDGE_ASSERT(!std::any_of(strideDims.cbegin(),
                               strideDims.cend(),
-                              [](DimSize_t val) { return val == 0; }),
-                 "{}: at least one of the stride dimension is 0, expecting "
+                              [](DimSize_t val) { return val <= 0; }),
+                 "{}: at least one of the stride dimension is 0,  <=expecting "
                  "strictly positive values. Got {}.",
                  Conv_Op<DIM>::Type,
                  strideDims);
-- 
GitLab