diff options
Diffstat (limited to 'src/armnn/NetworkQuantizerUtils.cpp')
-rw-r--r-- | src/armnn/NetworkQuantizerUtils.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/armnn/NetworkQuantizerUtils.cpp b/src/armnn/NetworkQuantizerUtils.cpp deleted file mode 100644 index dd0affde25..0000000000 --- a/src/armnn/NetworkQuantizerUtils.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "NetworkQuantizerUtils.hpp" - -#include <algorithm> -#include <cmath> -#include <stdint.h> - -namespace armnn -{ - -ConstTensor CreateQuantizedConst(const ConstTensor& tensor, std::vector<uint8_t>& backing) -{ - float scale = 0.0f; - int offset = 0; - - // Reserve the backing memory - backing.resize(tensor.GetInfo().GetNumElements()); - - DataType type = tensor.GetInfo().GetDataType(); - switch(type) - { - case DataType::Float32: - { - QuantizeConstant(static_cast<const float*>(tensor.GetMemoryArea()), - backing.data(), - backing.size(), - scale, - offset); - } - break; - default: - ARMNN_ASSERT_MSG(false, "Can't quantize unsupported data type"); - } - - TensorInfo qInfo(tensor.GetInfo().GetShape(), DataType::QAsymmU8, scale, offset); - return ConstTensor(qInfo, backing); -} - -} // namespace armnn |