aboutsummaryrefslogtreecommitdiff
path: root/chapters/tensor_ops.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'chapters/tensor_ops.adoc')
-rw-r--r--chapters/tensor_ops.adoc8
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>;