diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-10-25 16:13:22 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-10-28 09:57:55 -0700 |
commit | 82f19e2ad25bcbdde8e7f8b6bd6a6064a207fe36 (patch) | |
tree | c7a685d03bf2a9dd5a171b6c7409baf8c687da4f /chapters/tensor_ops.adoc | |
parent | 3fe5256340778f586b80ac02b0632b54a39723f1 (diff) | |
download | specification-82f19e2ad25bcbdde8e7f8b6bd6a6064a207fe36.tar.gz |
Readability fixes for pseudocode
Avoid use of acc for variables when they are not convolution
accumulators.
Use argument types appropriately.
Add missing pseudocode for some MI operators
Change-Id: I9113f9228dbcafb85206bcc39310e9599cb12c08
Diffstat (limited to 'chapters/tensor_ops.adoc')
-rw-r--r-- | chapters/tensor_ops.adoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chapters/tensor_ops.adoc b/chapters/tensor_ops.adoc index d7ced25..cfab5ba 100644 --- a/chapters/tensor_ops.adoc +++ b/chapters/tensor_ops.adoc @@ -98,8 +98,8 @@ ERROR_IF(pad_right >= kernel_x || pad_left >= kernel_x); ERROR_IF(pad_top >= kernel_y || pad_bottom >= kernel_y); // Output shape must match expected shape given the input shape // and arguments provided -ERROR_IF(H != floor((IH + pad_top + pad_bottom + stride_y - kernel_y) / stride_y)) -ERROR_IF(W != floor((IW + pad_left + pad_right + stride_x - kernel_x) / stride_x)) +ERROR_IF(H != idiv((IH + pad_top + pad_bottom + stride_y - kernel_y), stride_y)); +ERROR_IF(W != idiv((IW + pad_left + pad_right + stride_x - kernel_x), stride_x)); for_each(0 <= n < N, 0 <= oy < H, 0 <= ox < W, 0 <= c < C ) { in_t output_val; @@ -444,8 +444,8 @@ ERROR_IF(pad_right >= kernel_x || pad_left >= kernel_x); ERROR_IF(pad_top >= kernel_y || pad_bottom >= kernel_y); // Output shape must match expected shape given the input shape // and arguments provided -ERROR_IF(H != floor((IH + pad_top + pad_bottom + stride_y - kernel_y) / stride_y)) -ERROR_IF(W != floor((IW + pad_left + pad_right + stride_x - kernel_x) / stride_x)) +ERROR_IF(H != idiv((IH + pad_top + pad_bottom + stride_y - kernel_y), stride_y)); +ERROR_IF(W != idiv((IW + pad_left + pad_right + stride_x - kernel_x), stride_x)); for_each(0 <= n < N, 0 <= oy < H, 0 <= ox < W, 0 <= c < C ) { in_t acc = minimum_value<in_t>; |