diff options
author | alexander <alexander.efremov@arm.com> | 2021-04-29 20:36:09 +0100 |
---|---|---|
committer | Alexander Efremov <alexander.efremov@arm.com> | 2021-05-04 19:57:44 +0000 |
commit | c350cdced0a8a2ca17376f58813e6d48d796ac7c (patch) | |
tree | f732cde664837a7cb9429b17e1366bb31a635b15 /source/use_case/asr/src/Wav2LetterPostprocess.cc | |
parent | 6448932cc1c612d78e62c778ebb228b3cbe96a58 (diff) | |
download | ml-embedded-evaluation-kit-c350cdced0a8a2ca17376f58813e6d48d796ac7c.tar.gz |
MLECO-1868: Code static analyzer warnings fixes
Signed-off-by: alexander <alexander.efremov@arm.com>
Change-Id: Ie423e9cad3fabec6ab077ded7236813fe4933dea
Diffstat (limited to 'source/use_case/asr/src/Wav2LetterPostprocess.cc')
-rw-r--r-- | source/use_case/asr/src/Wav2LetterPostprocess.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/use_case/asr/src/Wav2LetterPostprocess.cc b/source/use_case/asr/src/Wav2LetterPostprocess.cc index 60ee51e..9157a6f 100644 --- a/source/use_case/asr/src/Wav2LetterPostprocess.cc +++ b/source/use_case/asr/src/Wav2LetterPostprocess.cc @@ -39,13 +39,13 @@ namespace asr { const bool lastIteration) { /* Basic checks. */ - if (!this->_IsInputValid(tensor, axisIdx)) { + if (!this->IsInputValid(tensor, axisIdx)) { return false; } /* Irrespective of tensor type, we use unsigned "byte" */ uint8_t* ptrData = tflite::GetTensorData<uint8_t>(tensor); - const uint32_t elemSz = this->_GetTensorElementSize(tensor); + const uint32_t elemSz = this->GetTensorElementSize(tensor); /* Other sanity checks. */ if (0 == elemSz) { @@ -59,13 +59,15 @@ namespace asr { /* Which axis do we need to process? */ switch (axisIdx) { case arm::app::Wav2LetterModel::ms_outputRowsIdx: - return this->_EraseSectionsRowWise(ptrData, - elemSz * tensor->dims->data[arm::app::Wav2LetterModel::ms_outputColsIdx], - lastIteration); + return this->EraseSectionsRowWise(ptrData, + elemSz * + tensor->dims->data[arm::app::Wav2LetterModel::ms_outputColsIdx], + lastIteration); case arm::app::Wav2LetterModel::ms_outputColsIdx: - return this->_EraseSectionsColWise(ptrData, - elemSz * tensor->dims->data[arm::app::Wav2LetterModel::ms_outputRowsIdx], - lastIteration); + return this->EraseSectionsColWise(ptrData, + elemSz * + tensor->dims->data[arm::app::Wav2LetterModel::ms_outputRowsIdx], + lastIteration); default: printf_err("Unsupported axis index: %u\n", axisIdx); } @@ -73,8 +75,8 @@ namespace asr { return false; } - bool Postprocess::_IsInputValid(TfLiteTensor* tensor, - const uint32_t axisIdx) const + bool Postprocess::IsInputValid(TfLiteTensor* tensor, + const uint32_t axisIdx) const { if (nullptr == tensor) { return false; @@ -96,17 +98,15 @@ namespace asr { return true; } - uint32_t Postprocess::_GetTensorElementSize(TfLiteTensor* tensor) + uint32_t Postprocess::GetTensorElementSize(TfLiteTensor* tensor) { switch(tensor->type) { case kTfLiteUInt8: - return 1; case kTfLiteInt8: return 1; case kTfLiteInt16: return 2; case kTfLiteInt32: - return 4; case kTfLiteFloat32: return 4; default: @@ -117,7 +117,7 @@ namespace asr { return 0; } - bool Postprocess::_EraseSectionsRowWise( + bool Postprocess::EraseSectionsRowWise( uint8_t* ptrData, const uint32_t strideSzBytes, const bool lastIteration) @@ -154,8 +154,8 @@ namespace asr { return true; } - bool Postprocess::_EraseSectionsColWise( - uint8_t* ptrData, + bool Postprocess::EraseSectionsColWise( + const uint8_t* ptrData, const uint32_t strideSzBytes, const bool lastIteration) { |