aboutsummaryrefslogtreecommitdiff
path: root/chapters/activation_funcs.adoc
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2022-04-29 16:15:56 +0100
committerDominic Symes <dominic.symes@arm.com>2022-05-03 13:36:22 +0000
commitcb6c6b33cc85d6c40d46b1ee78bcbd6a049017d5 (patch)
tree94988082f976e28f25cc13c0331efd119f83b3f2 /chapters/activation_funcs.adoc
parent5de08d1db3c1de4fddf3f4bb7a286db35cb9f9d1 (diff)
downloadspecification-cb6c6b33cc85d6c40d46b1ee78bcbd6a049017d5.tar.gz
Specify width of integer types
Clarify for types previously definded as int the width assumed by the specification. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: Ied62d4803a4323a600d33cff09752a76ca48f18d
Diffstat (limited to 'chapters/activation_funcs.adoc')
-rw-r--r--chapters/activation_funcs.adoc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chapters/activation_funcs.adoc b/chapters/activation_funcs.adoc
index 84a1039..87f213c 100644
--- a/chapters/activation_funcs.adoc
+++ b/chapters/activation_funcs.adoc
@@ -58,7 +58,7 @@ The sigmoid table has 513 entries each of 16-bit precision and covering the inpu
[source,c++]
----
-int sigmoid_reference(int x) {|// input x range is -256 to + 256 inclusive
+int16_t sigmoid_reference(int16_t x) { // input x range is -256 to + 256 inclusive
F64 v = (double)x / (double)16;
v = 1.0/(1.0 + exp(-v));
return round_to_nearest_int(32768.0 * v);
@@ -95,7 +95,7 @@ The tanh_table has 513 entries each of 16-bit precision and covering the input r
[source,c++]
----
-int tanh_reference(int x) { // input x range is -256 to +256 inclusive
+int16_t tanh_reference(int16_t x) { // input x range is -256 to +256 inclusive
F64 v = (double)x/(double)32;
v = exp(-2.0*v);
v = (1.0-v)/(1.0+v);