diff --git a/src/operator/Gather.cpp b/src/operator/Gather.cpp
index 2bba696e90f7239dd1079f9a91875be3bcab8a11..3eafe99efcf46e4ba498351eed160f7d48e37a17 100644
--- a/src/operator/Gather.cpp
+++ b/src/operator/Gather.cpp
@@ -27,12 +27,12 @@ void Aidge::Gather_Op::computeOutputDims() {
     }
 
     std::vector<DimSize_t> outDims = getInput(0)->dims();
-    std::vector<DimSize_t> gatheredShape = this->template getAttr<GatherAttr::GatheredShape>();
+    const std::vector<DimSize_t> gatheredShape = this->template getAttr<GatherAttr::GatheredShape>();
     // TODO: check indices and gatheredShape
 
-    std::int64_t axisIdx = this->template getAttr<GatherAttr::Axis>() >= 0 ?
-                           this->template getAttr<GatherAttr::Axis>() :
-                           this->template getAttr<GatherAttr::Axis>() + outDims.size();
+    const std::int64_t axisIdx = this->template getAttr<GatherAttr::Axis>() >= 0 ?
+                                 this->template getAttr<GatherAttr::Axis>() :
+                                 this->template getAttr<GatherAttr::Axis>() + outDims.size();
     outDims.erase(outDims.begin() + static_cast<std::size_t>(axisIdx));
     if (!gatheredShape.empty())
     {
diff --git a/src/operator/Slice.cpp b/src/operator/Slice.cpp
index 40f74adfb0e786af17e8fc14720f9098db387ddc..a0336c39b28fc6035a2f1e444439a0df01ae93bb 100644
--- a/src/operator/Slice.cpp
+++ b/src/operator/Slice.cpp
@@ -30,7 +30,7 @@ void Aidge::Slice_Op::computeOutputDims() {
         AIDGE_THROW_OR_ABORT(std::runtime_error, "Every input should be associated with a Tensor");
     }
 
-    DimSize_t nbAxes = this->template getAttr<SliceAttr::Axes>().size();
+    const DimSize_t nbAxes = this->template getAttr<SliceAttr::Axes>().size();
     std::vector<DimSize_t> outDims = getInput(0)->dims();
     for (std::size_t i = 0; i < nbAxes; ++i) {
         // For each slice operation get the params and cast them to size_t