From f450caa7d2ac9a2a90407fb81203228dc82ef4a1 Mon Sep 17 00:00:00 2001 From: Chunosov Date: Wed, 8 Nov 2017 16:09:35 +0700 Subject: COMPMID-661: softmax-uint8 implementation (#16) Change-Id: Iad11ce70a8a0878a48e445a092035c49c926cece Reviewed-on: http://mpd-gerrit.cambridge.arm.com/94855 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- tests/validation/CPP/SoftmaxLayer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/validation/CPP/SoftmaxLayer.cpp') diff --git a/tests/validation/CPP/SoftmaxLayer.cpp b/tests/validation/CPP/SoftmaxLayer.cpp index eb7655078c..8e8cc1bd25 100644 --- a/tests/validation/CPP/SoftmaxLayer.cpp +++ b/tests/validation/CPP/SoftmaxLayer.cpp @@ -112,6 +112,18 @@ SimpleTensor softmax_layer(const SimpleTensor &src) return dst; } +template <> +SimpleTensor softmax_layer(const SimpleTensor &src) +{ + // Note: Output quantization info should always have scale = 1/256 and offset = 0 + const QuantizationInfo output_quantization_info = QuantizationInfo(1.f / 256, 0); + + SimpleTensor src_tmp = convert_from_asymmetric(src); + SimpleTensor dst_tmp = softmax_layer(src_tmp); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_quantization_info); + return dst; +} + template SimpleTensor softmax_layer(const SimpleTensor &src); template SimpleTensor softmax_layer(const SimpleTensor &src); template SimpleTensor softmax_layer(const SimpleTensor &src); -- cgit v1.2.1