From fd3f8a3bd334fd3e57fd7a8f47826fcf130caabd Mon Sep 17 00:00:00 2001 From: Jerome Hue <jerome.hue@cea.fr> Date: Mon, 3 Mar 2025 10:10:45 +0100 Subject: [PATCH] Make a local function static Also remove some meaningless comments --- src/data/SpikeGen.cpp | 2 +- src/data/Tensor.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/data/SpikeGen.cpp b/src/data/SpikeGen.cpp index 91b1ec433..eecd6c86e 100644 --- a/src/data/SpikeGen.cpp +++ b/src/data/SpikeGen.cpp @@ -15,7 +15,7 @@ #include "aidge/data/Spikegen.hpp" namespace Aidge { -Tensor rateConvert(const Tensor& tensor) { +static Tensor rateConvert(const Tensor& tensor) { auto result = tensor.clone(); diff --git a/src/data/Tensor.cpp b/src/data/Tensor.cpp index cf8430684..d44168564 100644 --- a/src/data/Tensor.cpp +++ b/src/data/Tensor.cpp @@ -805,21 +805,19 @@ const Tensor& Tensor::ref(std::shared_ptr<Tensor>& fallback, Tensor Tensor::repeat(int times) const { AIDGE_ASSERT(times > 0, "repeat count must be positive"); - // Ensure that the source tensor is contiguous. Tensor src = *this; if (not src.isContiguous()) { src = src.clone(); src.makeContiguous(); } - // Build new dimensions: new_dims = {times} followed by current dims. + // Build new dimensions: new_dims = {times} followed by current dims std::vector<DimSize_t> newDims; newDims.push_back(static_cast<DimSize_t>(times)); for (const auto &d : dims()) { newDims.push_back(d); } - // Create an output tensor with the new dimensions. Tensor out(newDims); out.setDataType(dataType(), false); out.setDataFormat(dataFormat()); @@ -829,7 +827,6 @@ Tensor Tensor::repeat(int times) const { // Each "block" is a copy of the data from the original tensor. const std::size_t block = src.size(); - // Loop over the repeat count and copy the block each time. for (int i = 0; i < times; ++i) { // out.getImpl()->copy(source pointer, number of elements, destination offset) out.getImpl()->copy(src.getImpl()->rawPtr(src.getImplOffset()), -- GitLab