From c350cdced0a8a2ca17376f58813e6d48d796ac7c Mon Sep 17 00:00:00 2001 From: alexander Date: Thu, 29 Apr 2021 20:36:09 +0100 Subject: MLECO-1868: Code static analyzer warnings fixes Signed-off-by: alexander Change-Id: Ie423e9cad3fabec6ab077ded7236813fe4933dea --- source/application/hal/hal.c | 22 ++-- source/application/main/Classifier.cc | 117 ++++++++------------- source/application/main/Mfcc.cc | 61 ++++++----- source/application/main/PlatformMath.cc | 4 +- source/application/main/Profiler.cc | 6 +- source/application/main/include/Classifier.hpp | 2 +- source/application/main/include/DataStructures.hpp | 4 +- source/application/main/include/Mfcc.hpp | 24 ++--- source/application/main/include/Profiler.hpp | 4 +- source/application/tensorflow-lite-micro/Model.cc | 4 +- 10 files changed, 112 insertions(+), 136 deletions(-) (limited to 'source/application') diff --git a/source/application/hal/hal.c b/source/application/hal/hal.c index dbf94ba..9c2ce32 100644 --- a/source/application/hal/hal.c +++ b/source/application/hal/hal.c @@ -32,7 +32,7 @@ * @brief Initialises the Arm Ethos-U55 NPU * @return 0 if successful, error code otherwise **/ -static int _arm_npu_init(void); +static int arm_npu_init(void); #endif /* ARM_NPU */ @@ -54,7 +54,7 @@ int hal_init(hal_platform* platform, data_acq_module* data_acq, /** * @brief Local helper function to clean the slate for current platform. **/ -static void _hal_platform_clear(hal_platform* platform) +static void hal_platform_clear(hal_platform* platform) { assert(platform); platform->inited = 0; @@ -64,7 +64,7 @@ int hal_platform_init(hal_platform* platform) { int state; assert(platform && platform->platform_init); - _hal_platform_clear(platform); + hal_platform_clear(platform); /* Initialise platform */ if (0 != (state = platform->platform_init())) { @@ -94,7 +94,7 @@ int hal_platform_init(hal_platform* platform) #if defined(ARM_NPU) /* If Arm Ethos-U55 NPU is to be used, we initialise it here */ - if (0 != (state = _arm_npu_init())) { + if (0 != (state = arm_npu_init())) { return state; } @@ -120,7 +120,7 @@ void hal_platform_release(hal_platform *platform) data_acq_channel_release(platform->data_acq); data_psn_system_release(platform->data_psn); - _hal_platform_clear(platform); + hal_platform_clear(platform); info("releasing platform %s\n", platform->plat_name); platform->platform_release(); } @@ -130,7 +130,7 @@ void hal_platform_release(hal_platform *platform) * @brief Defines the Ethos-U interrupt handler: just a wrapper around the default * implementation. **/ -static void _arm_npu_irq_handler(void) +static void arm_npu_irq_handler(void) { /* Call the default interrupt handler from the NPU driver */ ethosu_irq_handler(); @@ -139,19 +139,19 @@ static void _arm_npu_irq_handler(void) /** * @brief Initialises the NPU IRQ **/ -static void _arm_npu_irq_init(void) +static void arm_npu_irq_init(void) { const IRQn_Type ethosu_irqnum = (IRQn_Type)EthosU_IRQn; /* Register the EthosU IRQ handler in our vector table. * Note, this handler comes from the EthosU driver */ - NVIC_SetVector(ethosu_irqnum, (uint32_t)_arm_npu_irq_handler); + NVIC_SetVector(ethosu_irqnum, (uint32_t)arm_npu_irq_handler); /* Enable the IRQ */ NVIC_EnableIRQ(ethosu_irqnum); debug("EthosU IRQ#: %u, Handler: 0x%p\n", - ethosu_irqnum, _arm_npu_irq_handler); + ethosu_irqnum, arm_npu_irq_handler); } static int _arm_npu_timing_adapter_init(void) @@ -213,7 +213,7 @@ static int _arm_npu_timing_adapter_init(void) return 0; } -static int _arm_npu_init(void) +static int arm_npu_init(void) { int err = 0; @@ -224,7 +224,7 @@ static int _arm_npu_init(void) } /* Initialise the IRQ */ - _arm_npu_irq_init(); + arm_npu_irq_init(); /* Initialise Ethos-U55 device */ const void * ethosu_base_address = (void *)(SEC_ETHOS_U55_BASE); diff --git a/source/application/main/Classifier.cc b/source/application/main/Classifier.cc index bc2c378..9a47f3d 100644 --- a/source/application/main/Classifier.cc +++ b/source/application/main/Classifier.cc @@ -28,69 +28,52 @@ namespace arm { namespace app { template - bool Classifier::_GetTopNResults(TfLiteTensor* tensor, - std::vector& vecResults, - uint32_t topNCount, - const std::vector & labels) - { - std::set> sortedSet; - - /* NOTE: inputVec's size verification against labels should be - * checked by the calling/public function. */ - T* tensorData = tflite::GetTensorData(tensor); - - /* Set initial elements. */ - for (uint32_t i = 0; i < topNCount; ++i) { - sortedSet.insert({tensorData[i], i}); - } - - /* Initialise iterator. */ - auto setFwdIter = sortedSet.begin(); - - /* Scan through the rest of elements with compare operations. */ - for (uint32_t i = topNCount; i < labels.size(); ++i) { - if (setFwdIter->first < tensorData[i]) { - sortedSet.erase(*setFwdIter); - sortedSet.insert({tensorData[i], i}); - setFwdIter = sortedSet.begin(); - } - } - - /* Final results' container. */ - vecResults = std::vector(topNCount); + void SetVectorResults(std::set>& topNSet, + std::vector& vecResults, + TfLiteTensor* tensor, + const std::vector & labels) { /* For getting the floating point values, we need quantization parameters. */ QuantParams quantParams = GetTensorQuantParams(tensor); /* Reset the iterator to the largest element - use reverse iterator. */ - auto setRevIter = sortedSet.rbegin(); - - /* Populate results - * Note: we could combine this loop with the loop above, but that - * would, involve more multiplications and other operations. - **/ - for (size_t i = 0; i < vecResults.size(); ++i, ++setRevIter) { - double score = static_cast (setRevIter->first); - vecResults[i].m_normalisedVal = quantParams.scale * - (score - quantParams.offset); - vecResults[i].m_label = labels[setRevIter->second]; - vecResults[i].m_labelIdx = setRevIter->second; + auto topNIter = topNSet.rbegin(); + for (size_t i = 0; i < vecResults.size() && topNIter != topNSet.rend(); ++i, ++topNIter) { + T score = topNIter->first; + vecResults[i].m_normalisedVal = quantParams.scale * (score - quantParams.offset); + vecResults[i].m_label = labels[topNIter->second]; + vecResults[i].m_labelIdx = topNIter->second; } - return true; } template<> - bool Classifier::_GetTopNResults(TfLiteTensor* tensor, - std::vector& vecResults, - uint32_t topNCount, - const std::vector & labels) + void SetVectorResults(std::set>& topNSet, + std::vector& vecResults, + TfLiteTensor* tensor, + const std::vector & labels) { + UNUSED(tensor); + /* Reset the iterator to the largest element - use reverse iterator. */ + auto topNIter = topNSet.rbegin(); + for (size_t i = 0; i < vecResults.size() && topNIter != topNSet.rend(); ++i, ++topNIter) { + vecResults[i].m_normalisedVal = topNIter->first; + vecResults[i].m_label = labels[topNIter->second]; + vecResults[i].m_labelIdx = topNIter->second; + } + + } + + template + bool Classifier::GetTopNResults(TfLiteTensor* tensor, + std::vector& vecResults, + uint32_t topNCount, + const std::vector & labels) { - std::set> sortedSet; + std::set> sortedSet; /* NOTE: inputVec's size verification against labels should be * checked by the calling/public function. */ - float* tensorData = tflite::GetTensorData(tensor); + T* tensorData = tflite::GetTensorData(tensor); /* Set initial elements. */ for (uint32_t i = 0; i < topNCount; ++i) { @@ -112,29 +95,18 @@ namespace app { /* Final results' container. */ vecResults = std::vector(topNCount); - /* Reset the iterator to the largest element - use reverse iterator. */ - auto setRevIter = sortedSet.rbegin(); - - /* Populate results - * Note: we could combine this loop with the loop above, but that - * would, involve more multiplications and other operations. - **/ - for (size_t i = 0; i < vecResults.size(); ++i, ++setRevIter) { - vecResults[i].m_normalisedVal = setRevIter->first; - vecResults[i].m_label = labels[setRevIter->second]; - vecResults[i].m_labelIdx = setRevIter->second; - } + SetVectorResults(sortedSet, vecResults, tensor, labels); return true; } - template bool Classifier::_GetTopNResults(TfLiteTensor* tensor, - std::vector& vecResults, - uint32_t topNCount, const std::vector & labels); + template bool Classifier::GetTopNResults(TfLiteTensor* tensor, + std::vector& vecResults, + uint32_t topNCount, const std::vector & labels); - template bool Classifier::_GetTopNResults(TfLiteTensor* tensor, - std::vector& vecResults, - uint32_t topNCount, const std::vector & labels); + template bool Classifier::GetTopNResults(TfLiteTensor* tensor, + std::vector& vecResults, + uint32_t topNCount, const std::vector & labels); bool Classifier::GetClassificationResults( TfLiteTensor* outputTensor, @@ -158,6 +130,9 @@ namespace app { } else if (totalOutputSize != labels.size()) { printf_err("Output size doesn't match the labels' size\n"); return false; + } else if (topNCount == 0) { + printf_err("Top N results cannot be zero\n"); + return false; } bool resultState; @@ -166,13 +141,13 @@ namespace app { /* Get the top N results. */ switch (outputTensor->type) { case kTfLiteUInt8: - resultState = _GetTopNResults(outputTensor, vecResults, topNCount, labels); + resultState = GetTopNResults(outputTensor, vecResults, topNCount, labels); break; case kTfLiteInt8: - resultState = _GetTopNResults(outputTensor, vecResults, topNCount, labels); + resultState = GetTopNResults(outputTensor, vecResults, topNCount, labels); break; case kTfLiteFloat32: - resultState = _GetTopNResults(outputTensor, vecResults, topNCount, labels); + resultState = GetTopNResults(outputTensor, vecResults, topNCount, labels); break; default: printf_err("Tensor type %s not supported by classifier\n", TfLiteTypeGetName(outputTensor->type)); @@ -180,7 +155,7 @@ namespace app { } if (!resultState) { - printf_err("Failed to get sorted set\n"); + printf_err("Failed to get top N results set\n"); return false; } diff --git a/source/application/main/Mfcc.cc b/source/application/main/Mfcc.cc index bf16159..9ddcb5d 100644 --- a/source/application/main/Mfcc.cc +++ b/source/application/main/Mfcc.cc @@ -44,7 +44,7 @@ namespace audio { m_useHtkMethod(useHtkMethod) {} - std::string MfccParams::Str() + std::string MfccParams::Str() const { char strC[1024]; snprintf(strC, sizeof(strC) - 1, "\n \ @@ -74,7 +74,7 @@ namespace audio { this->_m_params.m_numFbankBins, 0.0); this->_m_windowFunc = std::vector(this->_m_params.m_frameLen); - const float multiplier = 2 * M_PI / this->_m_params.m_frameLen; + const auto multiplier = static_cast(2 * M_PI / this->_m_params.m_frameLen); /* Create window function. */ for (size_t i = 0; i < this->_m_params.m_frameLen; i++) { @@ -88,7 +88,7 @@ namespace audio { void MFCC::Init() { - this->_InitMelFilterBank(); + this->InitMelFilterBank(); } float MFCC::MelScale(const float freq, const bool useHTKMethod) @@ -126,8 +126,8 @@ namespace audio { bool MFCC::ApplyMelFilterBank( std::vector& fftVec, std::vector>& melFilterBank, - std::vector& filterBankFilterFirst, - std::vector& filterBankFilterLast, + std::vector& filterBankFilterFirst, + std::vector& filterBankFilterLast, std::vector& melEnergies) { const size_t numBanks = melEnergies.size(); @@ -140,11 +140,12 @@ namespace audio { for (size_t bin = 0; bin < numBanks; ++bin) { auto filterBankIter = melFilterBank[bin].begin(); + auto end = melFilterBank[bin].end(); float melEnergy = FLT_MIN; /* Avoid log of zero at later stages */ - int32_t firstIndex = filterBankFilterFirst[bin]; - int32_t lastIndex = filterBankFilterLast[bin]; + const uint32_t firstIndex = filterBankFilterFirst[bin]; + const uint32_t lastIndex = std::min(filterBankFilterLast[bin], fftVec.size() - 1); - for (int i = firstIndex; i <= lastIndex; i++) { + for (uint32_t i = firstIndex; i <= lastIndex && filterBankIter != end; i++) { float energyRep = math::MathUtils::SqrtF32(fftVec[i]); melEnergy += (*filterBankIter++ * energyRep); } @@ -157,14 +158,14 @@ namespace audio { void MFCC::ConvertToLogarithmicScale(std::vector& melEnergies) { - for (size_t bin = 0; bin < melEnergies.size(); ++bin) { - melEnergies[bin] = logf(melEnergies[bin]); + for (float& melEnergy : melEnergies) { + melEnergy = logf(melEnergy); } } - void MFCC::_ConvertToPowerSpectrum() + void MFCC::ConvertToPowerSpectrum() { - const uint32_t halfDim = this->_m_params.m_frameLenPadded / 2; + const uint32_t halfDim = this->_m_buffer.size() / 2; /* Handle this special case. */ float firstEnergy = this->_m_buffer[0] * this->_m_buffer[0]; @@ -193,7 +194,7 @@ namespace audio { for (int32_t k = 0, m = 0; k < coefficientCount; k++, m += inputLength) { for (int32_t n = 0; n < inputLength; n++) { dctMatix[m+n] = normalizer * - math::MathUtils::CosineF32((n + 0.5) * angle); + math::MathUtils::CosineF32((n + 0.5f) * angle); } angle += angleIncr; } @@ -214,10 +215,10 @@ namespace audio { return 1.f; } - void MFCC::_InitMelFilterBank() + void MFCC::InitMelFilterBank() { - if (!this->_IsMelFilterBankInited()) { - this->_m_melFilterBank = this->_CreateMelFilterBank(); + if (!this->IsMelFilterBankInited()) { + this->_m_melFilterBank = this->CreateMelFilterBank(); this->_m_dctMatrix = this->CreateDCTMatrix( this->_m_params.m_numFbankBins, this->_m_params.m_numMfccFeatures); @@ -225,17 +226,17 @@ namespace audio { } } - bool MFCC::_IsMelFilterBankInited() + bool MFCC::IsMelFilterBankInited() const { return this->_m_filterBankInitialised; } - void MFCC::_MfccComputePreFeature(const std::vector& audioData) + void MFCC::MfccComputePreFeature(const std::vector& audioData) { - this->_InitMelFilterBank(); + this->InitMelFilterBank(); /* TensorFlow way of normalizing .wav data to (-1, 1). */ - constexpr float normaliser = 1.0/(1<<15); + constexpr float normaliser = 1.0/(1u<<15u); for (size_t i = 0; i < this->_m_params.m_frameLen; i++) { this->_m_frame[i] = static_cast(audioData[i]) * normaliser; } @@ -252,7 +253,7 @@ namespace audio { math::MathUtils::FftF32(this->_m_frame, this->_m_buffer, this->_m_fftInstance); /* Convert to power spectrum. */ - this->_ConvertToPowerSpectrum(); + this->ConvertToPowerSpectrum(); /* Apply mel filterbanks. */ if (!this->ApplyMelFilterBank(this->_m_buffer, @@ -269,7 +270,7 @@ namespace audio { std::vector MFCC::MfccCompute(const std::vector& audioData) { - this->_MfccComputePreFeature(audioData); + this->MfccComputePreFeature(audioData); std::vector mfccOut(this->_m_params.m_numMfccFeatures); @@ -288,7 +289,7 @@ namespace audio { return mfccOut; } - std::vector> MFCC::_CreateMelFilterBank() + std::vector> MFCC::CreateMelFilterBank() { size_t numFftBins = this->_m_params.m_frameLenPadded / 2; float fftBinWidth = static_cast(this->_m_params.m_samplingFreq) / this->_m_params.m_frameLenPadded; @@ -303,17 +304,18 @@ namespace audio { std::vector> melFilterBank( this->_m_params.m_numFbankBins); this->_m_filterBankFilterFirst = - std::vector(this->_m_params.m_numFbankBins); + std::vector(this->_m_params.m_numFbankBins); this->_m_filterBankFilterLast = - std::vector(this->_m_params.m_numFbankBins); + std::vector(this->_m_params.m_numFbankBins); for (size_t bin = 0; bin < this->_m_params.m_numFbankBins; bin++) { float leftMel = melLowFreq + bin * melFreqDelta; float centerMel = melLowFreq + (bin + 1) * melFreqDelta; float rightMel = melLowFreq + (bin + 2) * melFreqDelta; - int32_t firstIndex = -1; - int32_t lastIndex = -1; + uint32_t firstIndex = 0; + uint32_t lastIndex = 0; + bool firstIndexFound = false; const float normaliser = this->GetMelFilterBankNormaliser(leftMel, rightMel, this->_m_params.m_useHtkMethod); for (size_t i = 0; i < numFftBins; i++) { @@ -330,8 +332,9 @@ namespace audio { } thisBin[i] = weight * normaliser; - if (firstIndex == -1) { + if (!firstIndexFound) { firstIndex = i; + firstIndexFound = true; } lastIndex = i; } @@ -341,7 +344,7 @@ namespace audio { this->_m_filterBankFilterLast[bin] = lastIndex; /* Copy the part we care about. */ - for (int32_t i = firstIndex; i <= lastIndex; i++) { + for (uint32_t i = firstIndex; i <= lastIndex; i++) { melFilterBank[bin].push_back(thisBin[i]); } } diff --git a/source/application/main/PlatformMath.cc b/source/application/main/PlatformMath.cc index a9f5049..9d18151 100644 --- a/source/application/main/PlatformMath.cc +++ b/source/application/main/PlatformMath.cc @@ -121,7 +121,7 @@ namespace math { float sumReal = 0, sumImag = 0; for (int t = 0; t < inputLength; t++) { - float angle = 2 * M_PI * t * k / inputLength; + auto angle = static_cast(2 * M_PI * t * k / inputLength); sumReal += input[t] * cosf(angle); sumImag += -input[t] * sinf(angle); } @@ -147,7 +147,7 @@ namespace math { output.size()); #else /* ARM_DSP_AVAILABLE */ for (auto in = input.begin(), out = output.begin(); - in != input.end(); ++in, ++out) { + in != input.end() && out != output.end(); ++in, ++out) { *out = logf(*in); } #endif /* ARM_DSP_AVAILABLE */ diff --git a/source/application/main/Profiler.cc b/source/application/main/Profiler.cc index 0456ba4..10a828a 100644 --- a/source/application/main/Profiler.cc +++ b/source/application/main/Profiler.cc @@ -54,7 +54,7 @@ namespace app { this->_m_tstampEnd = this->_m_pPlatform->timer->stop_profiling(); this->_m_started = false; - this->_AddProfilingUnit(this->_m_tstampSt, this->_m_tstampEnd, this->_m_name); + this->AddProfilingUnit(this->_m_tstampSt, this->_m_tstampEnd, this->_m_name); return true; } @@ -238,8 +238,8 @@ namespace app { this->_m_name = std::string(str); } - void Profiler::_AddProfilingUnit(time_counter start, time_counter end, - const std::string& name) + void Profiler::AddProfilingUnit(time_counter start, time_counter end, + const std::string& name) { platform_timer * timer = this->_m_pPlatform->timer; diff --git a/source/application/main/include/Classifier.hpp b/source/application/main/include/Classifier.hpp index 510e6f9..3ee3148 100644 --- a/source/application/main/include/Classifier.hpp +++ b/source/application/main/include/Classifier.hpp @@ -62,7 +62,7 @@ namespace app { * @return true if successful, false otherwise. **/ template - bool _GetTopNResults(TfLiteTensor* tensor, + bool GetTopNResults(TfLiteTensor* tensor, std::vector& vecResults, uint32_t topNCount, const std::vector & labels); diff --git a/source/application/main/include/DataStructures.hpp b/source/application/main/include/DataStructures.hpp index 5cc8b5e..2f267c0 100644 --- a/source/application/main/include/DataStructures.hpp +++ b/source/application/main/include/DataStructures.hpp @@ -47,15 +47,13 @@ namespace app { * @param[in] rows Number of rows. * @param[in] cols Number of columns. */ - Array2d(unsigned rows, unsigned cols) + Array2d(unsigned rows, unsigned cols): _m_rows(rows), _m_cols(cols) { if (rows == 0 || cols == 0) { printf_err("Array2d constructor has 0 size.\n"); _m_data = nullptr; return; } - _m_rows = rows; - _m_cols = cols; _m_data = new T[rows * cols]; } diff --git a/source/application/main/include/Mfcc.hpp b/source/application/main/include/Mfcc.hpp index 6379fab..dcafe62 100644 --- a/source/application/main/include/Mfcc.hpp +++ b/source/application/main/include/Mfcc.hpp @@ -52,7 +52,7 @@ namespace audio { ~MfccParams() = default; /** @brief String representation of parameters */ - std::string Str(); + std::string Str() const; }; /** @@ -100,7 +100,7 @@ namespace audio { const float quantScale, const int quantOffset) { - this->_MfccComputePreFeature(audioData); + this->MfccComputePreFeature(audioData); float minVal = std::numeric_limits::min(); float maxVal = std::numeric_limits::max(); @@ -154,7 +154,7 @@ namespace audio { * bank weights and adding them up to be placed into * bins, according to the filter bank's first and last * indices (pre-computed for each filter bank element - * by _CreateMelFilterBank function). + * by CreateMelFilterBank function). * @param[in] fftVec Vector populated with FFT magnitudes. * @param[in] melFilterBank 2D Vector with filter bank weights. * @param[in] filterBankFilterFirst Vector containing the first indices of filter bank @@ -168,8 +168,8 @@ namespace audio { virtual bool ApplyMelFilterBank( std::vector& fftVec, std::vector>& melFilterBank, - std::vector& filterBankFilterFirst, - std::vector& filterBankFilterLast, + std::vector& filterBankFilterFirst, + std::vector& filterBankFilterLast, std::vector& melEnergies); /** @@ -214,37 +214,37 @@ namespace audio { std::vector _m_windowFunc; std::vector> _m_melFilterBank; std::vector _m_dctMatrix; - std::vector _m_filterBankFilterFirst; - std::vector _m_filterBankFilterLast; + std::vector _m_filterBankFilterFirst; + std::vector _m_filterBankFilterLast; bool _m_filterBankInitialised; arm::app::math::FftInstance _m_fftInstance; /** * @brief Initialises the filter banks and the DCT matrix. **/ - void _InitMelFilterBank(); + void InitMelFilterBank(); /** * @brief Signals whether the instance of MFCC has had its * required buffers initialised. * @return true if initialised, false otherwise. **/ - bool _IsMelFilterBankInited(); + bool IsMelFilterBankInited() const; /** * @brief Create mel filter banks for MFCC calculation. * @return 2D vector of floats. **/ - std::vector> _CreateMelFilterBank(); + std::vector> CreateMelFilterBank(); /** * @brief Computes and populates internal memeber buffers used * in MFCC feature calculation * @param[in] audioData 1D vector of 16-bit audio data. */ - void _MfccComputePreFeature(const std::vector& audioData); + void MfccComputePreFeature(const std::vector& audioData); /** @brief Computes the magnitude from an interleaved complex array. */ - void _ConvertToPowerSpectrum(); + void ConvertToPowerSpectrum(); }; diff --git a/source/application/main/include/Profiler.hpp b/source/application/main/include/Profiler.hpp index d93b257..c5f77e7 100644 --- a/source/application/main/include/Profiler.hpp +++ b/source/application/main/include/Profiler.hpp @@ -125,8 +125,8 @@ namespace app { * @param[in] name Name for the profiling unit series to be * appended to. **/ - void _AddProfilingUnit(time_counter start, time_counter end, - const std::string& name); + void AddProfilingUnit(time_counter start, time_counter end, + const std::string& name); }; } /* namespace app */ diff --git a/source/application/tensorflow-lite-micro/Model.cc b/source/application/tensorflow-lite-micro/Model.cc index 0775467..abf97b6 100644 --- a/source/application/tensorflow-lite-micro/Model.cc +++ b/source/application/tensorflow-lite-micro/Model.cc @@ -317,7 +317,7 @@ bool arm::app::Model::ShowModelInfoHandler() } namespace arm { namespace app { - static uint8_t _tensor_arena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + static uint8_t tensor_arena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; } /* namespace app */ } /* namespace arm */ @@ -328,5 +328,5 @@ size_t arm::app::Model::GetActivationBufferSize() uint8_t *arm::app::Model::GetTensorArena() { - return _tensor_arena; + return tensor_arena; } \ No newline at end of file -- cgit v1.2.1