diff options
author | Eric Kunze <eric.kunze@arm.com> | 2022-05-24 15:24:17 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-05-26 14:51:19 -0700 |
commit | 844b3b4745e673502e80899a005933b1fc1fd72e (patch) | |
tree | 912fddd22c7700b94b7a893826e06176b932f544 /chapters/pseudocode.adoc | |
parent | d8f725c0d9f99de70913ed6319fbca9d8b72be3a (diff) | |
download | specification-844b3b4745e673502e80899a005933b1fc1fd72e.tar.gz |
Update RESHAPE pseudocode
Remove the calculation of a -1 dimension from the operator.
Calculates the new coordinates, and adds the proper
tensor_read/tensor_write for the data.
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: Iad1d83c170732bdfb3652dead9044809168b23d2
Diffstat (limited to 'chapters/pseudocode.adoc')
-rw-r--r-- | chapters/pseudocode.adoc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chapters/pseudocode.adoc b/chapters/pseudocode.adoc index a370880..d22d180 100644 --- a/chapters/pseudocode.adoc +++ b/chapters/pseudocode.adoc @@ -203,4 +203,13 @@ int32_t sum(in_t input[]) bool isNaN(float input) return True if floating-point input value is NaN + +// Input is the shape of the given tensor +int32_t tensor_size(int32_t input[]) { + int32_t size = 1; + for (int32_t i=0; i < rank(input); i++) { + size *= input[i]; + } + return size; +} ---- |