aboutsummaryrefslogtreecommitdiff
path: root/src/backends/aclCommon/ArmComputeTensorUtils.cpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2019-07-25 08:39:31 +0100
committerMike Kelly <mike.kelly@arm.com>2019-07-25 08:39:31 +0100
commit0a08ec6e5764d7906d196df5fe2979ad0d28d10a (patch)
tree68974b4cae8bbef85b0199225c01346034dcb06e /src/backends/aclCommon/ArmComputeTensorUtils.cpp
parentd73cecba2fb3525453d102603f6f27a9636754b5 (diff)
downloadarmnn-0a08ec6e5764d7906d196df5fe2979ad0d28d10a.tar.gz
IVGCVSW-3521 CpuAcc V1.2 pad Failures
* Pad value for QASYMM8 is no longer stored in quantized form. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I048e1d233353c0560ae03a7cc1ed5199295352bc
Diffstat (limited to 'src/backends/aclCommon/ArmComputeTensorUtils.cpp')
-rw-r--r--src/backends/aclCommon/ArmComputeTensorUtils.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/backends/aclCommon/ArmComputeTensorUtils.cpp b/src/backends/aclCommon/ArmComputeTensorUtils.cpp
index e69232c5a1..fabe9a15bf 100644
--- a/src/backends/aclCommon/ArmComputeTensorUtils.cpp
+++ b/src/backends/aclCommon/ArmComputeTensorUtils.cpp
@@ -210,5 +210,23 @@ arm_compute::Size2D BuildArmComputeSize2D(const unsigned int width, const unsign
return arm_compute::Size2D(width, height);
}
+arm_compute::PixelValue GetPixelValue(arm_compute::ITensor& input, float pixelValue)
+{
+ switch (input.info()->data_type())
+ {
+ case arm_compute::DataType::QASYMM8:
+ return arm_compute::PixelValue(static_cast<uint8_t>(pixelValue));
+ case arm_compute::DataType::QSYMM16:
+ return arm_compute::PixelValue(static_cast<int16_t>(pixelValue));
+ case arm_compute::DataType::F16:
+ return arm_compute::PixelValue(static_cast<Half>(pixelValue));
+ case arm_compute::DataType::F32:
+ return arm_compute::PixelValue(pixelValue);
+ default:
+ throw InvalidArgumentException("Unsupported DataType: [" +
+ std::to_string(static_cast<int>(input.info()->data_type())) + "]");
+ }
+}
+
} // namespace armcomputetensorutils
} // namespace armnn