diff --git a/include/aidge/operator/Add.hpp b/include/aidge/operator/Add.hpp index 2575e165b234bd425cfc57441e536b12ddb6f03c..aa249a228f3692673b711c1224ce178c3944f049 100644 --- a/include/aidge/operator/Add.hpp +++ b/include/aidge/operator/Add.hpp @@ -108,8 +108,9 @@ public: assert(static_cast<std::size_t>(inputIdx) < NUM && "wrong inputIdx for Add operator."); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/AvgPooling.hpp b/include/aidge/operator/AvgPooling.hpp index a431844376ca8d0551cc75387278cca4662beae6..bfd5dc89b9b1bdf56a69d9297124a1a514993eae 100644 --- a/include/aidge/operator/AvgPooling.hpp +++ b/include/aidge/operator/AvgPooling.hpp @@ -108,12 +108,14 @@ public: } - std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const override final { assert(inputIdx == 0 && "operators supports only 1 inputs"); + (void) inputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/BatchNorm.hpp b/include/aidge/operator/BatchNorm.hpp index cecf006b08ac14b16ed181c49c999080d3079a54..4817ce5f5af4b0b638ad4c08fc0bfe8d01d67135 100644 --- a/include/aidge/operator/BatchNorm.hpp +++ b/include/aidge/operator/BatchNorm.hpp @@ -107,8 +107,9 @@ public: assert(inputIdx < 5 && "operators supports only 5 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Conv.hpp b/include/aidge/operator/Conv.hpp index df0876941962cb2ac75dcf9ac5df1258ed4d1086..51e4f36c9031c6eb5281c869aac30c0d3ef28296 100644 --- a/include/aidge/operator/Conv.hpp +++ b/include/aidge/operator/Conv.hpp @@ -121,8 +121,9 @@ public: assert(inputIdx < 3 && "Conv Operators supports only 3 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "Conv Operator has only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } diff --git a/include/aidge/operator/ConvDepthWise.hpp b/include/aidge/operator/ConvDepthWise.hpp index e3102d385384a60160246636e941c779df3e557c..788541564715227a97179318c61828ce668ce655 100644 --- a/include/aidge/operator/ConvDepthWise.hpp +++ b/include/aidge/operator/ConvDepthWise.hpp @@ -121,8 +121,9 @@ class ConvDepthWise_Op : public Operator, assert(inputIdx < 3 && "ConvDepthWise Operators supports only 3 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "ConvDepthWise Operator has only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } diff --git a/include/aidge/operator/FC.hpp b/include/aidge/operator/FC.hpp index 5b81282392c4ba9cc47e2f9283ca8b277715acd8..6e4c54a030c108c29c08a8f5dfdc24d084ccc91c 100644 --- a/include/aidge/operator/FC.hpp +++ b/include/aidge/operator/FC.hpp @@ -98,7 +98,7 @@ public: } inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "FC Operator has only 1 output"); - (void) outputIdx; + (void) outputIdx; // avoid unused warning return mOutput; } @@ -109,7 +109,7 @@ public: } std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); - (void) outputIdx; + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/LeakyReLU.hpp b/include/aidge/operator/LeakyReLU.hpp index 4270ab487d12274a8445a28135a367b776592ac6..64587d51de784082da455eb64aa5bbe175773b5d 100644 --- a/include/aidge/operator/LeakyReLU.hpp +++ b/include/aidge/operator/LeakyReLU.hpp @@ -53,8 +53,9 @@ public: setDatatype(DataType::Float32); } - void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); } @@ -73,22 +74,26 @@ public: inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert((inputIdx == 0) && "LeakyReLU Operator has only 1 input"); + (void) inputIdx; // avoid unused warning return mInput; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "LeakyReLU Operator has only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } - std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } diff --git a/include/aidge/operator/Matmul.hpp b/include/aidge/operator/Matmul.hpp index 58ea91b9176a11037dfbffad92a543c2dc9301e3..b44e8a9b9540e287ff35af1c9642c8202fd096d0 100644 --- a/include/aidge/operator/Matmul.hpp +++ b/include/aidge/operator/Matmul.hpp @@ -55,7 +55,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { assert(inputIdx < 2 && "operators supports only 2 inputs"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInputs[inputIdx] = std::dynamic_pointer_cast<Tensor>(data); @@ -88,8 +88,9 @@ public: assert(inputIdx < 2 && "MatMul Operators has 2 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "MatMul Operators has 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } @@ -98,8 +99,9 @@ public: assert(inputIdx < 2 && "operators supports only 2 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Producer.hpp b/include/aidge/operator/Producer.hpp index cc02a9af0f754ce09ef49fbeb0f1de183c07c62d..1f77400ce8a8ef727ea9e0a7d12477c6519ea2df 100644 --- a/include/aidge/operator/Producer.hpp +++ b/include/aidge/operator/Producer.hpp @@ -73,7 +73,7 @@ public: } inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "Producer Operator has only 1 output"); - (void) outputIdx; + (void) outputIdx; // avoid unused warning return mOutput; } @@ -85,7 +85,7 @@ public: std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); - (void) outputIdx; + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/ReLU.hpp b/include/aidge/operator/ReLU.hpp index 972a73388fba9421be67ae1bcc42ddfd1f9407eb..3ea90462cf2b083a1a61ae39be06471093ec9f9f 100644 --- a/include/aidge/operator/ReLU.hpp +++ b/include/aidge/operator/ReLU.hpp @@ -42,8 +42,9 @@ public: setDatatype(DataType::Float32); } - void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); } @@ -62,22 +63,26 @@ public: inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert((inputIdx == 0) && "ReLU Operator has only 1 input"); + (void) inputIdx; // avoid unused warning return mInput; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "ReLU Operator has only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } - std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Softmax.hpp b/include/aidge/operator/Softmax.hpp index 81eb7fa90fc6708ae79d000db346c2a6126eb1db..93eb262f703ca7eb385641c77df7ae7e79c00b96 100644 --- a/include/aidge/operator/Softmax.hpp +++ b/include/aidge/operator/Softmax.hpp @@ -42,8 +42,9 @@ public: setDatatype(DataType::Float32); } - void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); } @@ -62,22 +63,26 @@ public: inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert((inputIdx == 0) && "Softmax Operator has only 1 input"); + (void) inputIdx; // avoid unused warning return mInput; } - inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t outputIdx) const override final { assert((outputIdx == 0) && "Softmax Operator has only 1 output"); + (void) outputIdx; // avoid unused warning return mOutput; } - std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); + (void) inputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); + (void) outputIdx; // avoid unused warning return std::static_pointer_cast<Data>(mOutput); } diff --git a/python_binding/data/pybind_Tensor.cpp b/python_binding/data/pybind_Tensor.cpp index 3f741946da59a118b023f0204da4f42231c1416d..d6442723ecc79527e8eaa7d3e03a466c085dfa58 100644 --- a/python_binding/data/pybind_Tensor.cpp +++ b/python_binding/data/pybind_Tensor.cpp @@ -98,9 +98,9 @@ void init_Tensor(py::module& m){ .def_buffer([](Tensor& b) -> py::buffer_info { const std::unique_ptr<TensorImpl>& tensorImpl = b.getImpl(); - std::vector<ssize_t> dims; - std::vector<ssize_t> strides; - ssize_t stride = tensorImpl->scalarSize(); + std::vector<size_t> dims; + std::vector<size_t> strides; + size_t stride = tensorImpl->scalarSize(); for (unsigned int dim = b.nbDims(); dim > 0; dim--) { dims.push_back(b.dims()[dim-1]); diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index e8b29c67cf0b71c61a11f4ee07c57371af14a2a8..ad412f5b86d9cf0dee0823736548baeb7c7320a7 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -30,13 +30,13 @@ Aidge::Connector Aidge::GraphView::operator()( assert((ctors.size() == static_cast<std::size_t>(inNode->nbDataInputs())) && "Wrong number of arguments.\n"); for (std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inNode->inputs()) { assert((gk_IODefaultIndex == input.second) && "At least one input connection is not free.\n"); - (void)input; // Suppress ununsed warning + (void)input; // avoid unused warning } for (const Connector &ctor : ctors) { assert((ctor.node() != nullptr) && "Input Connector must be associated with a node"); - (void)ctors; // Suppress ununsed warning + (void)ctors; // avoid unused warning } IOIndex_t inID = 0; for (const Connector &ctor : ctors) { diff --git a/src/graph/Node.cpp b/src/graph/Node.cpp index f4e2b58185d70223b9319c81b221e1ad5bb04459..b3db5befbdc8299114514d8d554d439bffc5eae2 100644 --- a/src/graph/Node.cpp +++ b/src/graph/Node.cpp @@ -37,7 +37,7 @@ Aidge::Connector Aidge::Node::operator()(const std::vector<Connector> &ctors) { assert((ctors.size() == nbDataInputs()) && "Wrong number of arguments.\n"); for (std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inputs()) { assert((gk_IODefaultIndex == input.second) && "At least one input connection is not free.\n"); - (void) input; + (void) input; // avoid unused warning } IOIndex_t i = 0; for (const Connector &ctor : ctors) {