diff options
Diffstat (limited to 'pseudocode/operators')
-rw-r--r-- | pseudocode/operators/ABS.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/ARGMAX.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/AVG_POOL2D.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/INTDIV.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/MUL.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/NEGATE.tosac | 4 | ||||
-rw-r--r-- | pseudocode/operators/REDUCE_MIN.tosac | 2 | ||||
-rw-r--r-- | pseudocode/operators/RESCALE.tosac | 8 | ||||
-rw-r--r-- | pseudocode/operators/RESIZE.tosac | 8 |
10 files changed, 17 insertions, 17 deletions
diff --git a/pseudocode/operators/ABS.tosac b/pseudocode/operators/ABS.tosac index 5f7f56e..94f439c 100644 --- a/pseudocode/operators/ABS.tosac +++ b/pseudocode/operators/ABS.tosac @@ -9,7 +9,7 @@ for_each(index in shape) { in_out_t value1 = tensor_read<in_out_t>(input1, shape, index); - if (is_floating_point(in_out_t) && value1 == -0.0) { + if (is_floating_point<in_out_t>() && value1 == -0.0) { value1 = 0.0; } if (static_cast<int32_t>(value1) < 0.0) { diff --git a/pseudocode/operators/ARGMAX.tosac b/pseudocode/operators/ARGMAX.tosac index 73b74a0..ac7aa7a 100644 --- a/pseudocode/operators/ARGMAX.tosac +++ b/pseudocode/operators/ARGMAX.tosac @@ -21,7 +21,7 @@ if (axis == rank(shape1)-1) { ERROR_IF(flatten(left_shape, right_shape) != shape); for_each(left_index in left_shape) { for_each(right_index in right_shape) { - in_t max_value = minimum_s<in_t>; + in_t max_value = minimum_s<in_t>(); out_t max_index = 0; for (i = 0; i < shape1[axis]; i++) { shape_t index = flatten(left_index, [i], right_index); diff --git a/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac b/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac index dd07fc5..36d01ed 100644 --- a/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac +++ b/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac @@ -24,6 +24,6 @@ for_each(index in shape) { (apply_arith_rshift<in_out_t>(value1, apply_sub_s<in_out_t>(value2, 1)) & 1 != 0)) { result = result + 1; } - result = apply_clip_s<in_out_t>(result, minimum_s<in_out_t>, maximum_s<in_out_t>); + result = apply_clip_s<in_out_t>(result, minimum_s<in_out_t>(), maximum_s<in_out_t>()); tensor_write<in_out_t>(output, shape, index, result); } diff --git a/pseudocode/operators/AVG_POOL2D.tosac b/pseudocode/operators/AVG_POOL2D.tosac index f452d12..6df313b 100644 --- a/pseudocode/operators/AVG_POOL2D.tosac +++ b/pseudocode/operators/AVG_POOL2D.tosac @@ -43,7 +43,7 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW, 0 <= c < C ) { scale_t scale = reciprocal_scale(count); acc = apply_scale_32(acc, scale.multiplier, scale.shift, false); acc = apply_add_s<acc_t>(acc, sign_extend<acc_t>(output_zp)); - acc = apply_clip_s<acc_t>(acc, minimum_s<in_out_t>, maximum_s<in_out_t>); + acc = apply_clip_s<acc_t>(acc, minimum_s<in_out_t>(), maximum_s<in_out_t>()); output_val = static_cast<in_out_t>(acc); } tensor_write<in_out_t>(output, [N,OH,OW,C], [n,oy,ox,c], output_val); diff --git a/pseudocode/operators/INTDIV.tosac b/pseudocode/operators/INTDIV.tosac index bf3126b..a6774fa 100644 --- a/pseudocode/operators/INTDIV.tosac +++ b/pseudocode/operators/INTDIV.tosac @@ -16,7 +16,7 @@ for_each(index in shape) { REQUIRE(value2 != 0); // This catches the case where we divide minimum<in_out_t> by -1 // which is not representable in two's complement - REQUIRE(static_cast<int64_t>(value1) / static_cast<int64_t>(value2) <= maximum_s<in_out_t>); + REQUIRE(static_cast<int64_t>(value1) / static_cast<int64_t>(value2) <= maximum_s<in_out_t>()); in_out_t result = apply_intdiv_s<in_out_t>(value1, value2); tensor_write<in_out_t>(output, shape, index, result); } diff --git a/pseudocode/operators/MUL.tosac b/pseudocode/operators/MUL.tosac index 5cc9f80..13c4a17 100644 --- a/pseudocode/operators/MUL.tosac +++ b/pseudocode/operators/MUL.tosac @@ -20,7 +20,7 @@ for_each(index in shape) { int64_t product = sign_extend<int64_t>(value1) * sign_extend<int64_t>(value2); int64_t round = static_cast<int64_t>(1) << (shift - 1); product = (product + round) >> shift; - REQUIRE(product >= minimum_s<i32_t> && product <= maximum_s<i32_t>) + REQUIRE(product >= minimum_s<i32_t>() && product <= maximum_s<i32_t>()) result = product; } else { result = apply_mul_s(value1, value2); // low 32-bits of result for i32_t diff --git a/pseudocode/operators/NEGATE.tosac b/pseudocode/operators/NEGATE.tosac index cae57f3..b0f12d1 100644 --- a/pseudocode/operators/NEGATE.tosac +++ b/pseudocode/operators/NEGATE.tosac @@ -16,7 +16,7 @@ for_each(index in shape) { value = apply_sub_s<acc_t>(0, value); value = apply_add_s<acc_t>(value, sign_extend<acc_t>(output_zp)); in_out_t result = truncate<in_out_t>(apply_clip_s<acc_t>(value, - minimum_s<in_out_t>, - maximum_s<in_out_t>)); + minimum_s<in_out_t>(), + maximum_s<in_out_t>())); tensor_write<in_out_t>(output, shape, index, result); } diff --git a/pseudocode/operators/REDUCE_MIN.tosac b/pseudocode/operators/REDUCE_MIN.tosac index 7e1f92d..437ecfd 100644 --- a/pseudocode/operators/REDUCE_MIN.tosac +++ b/pseudocode/operators/REDUCE_MIN.tosac @@ -13,7 +13,7 @@ left_shape = (axis > 1) ? shape[0:axis-1] : []; right_shape = (axis < rank(shape)-1) ? shape[axis+1:rank(shape)-1] : []; for_each(left_index in left_shape) { for_each(right_index in right_shape) { - in_out_t acc = maximum<in_out_t>; + in_out_t acc = maximum<in_out_t>(); for (i = 0; i < shape1[axis]; i++) { index = flatten(left_index, [i], right_index); in_out_t value = tensor_read<in_out_t>(input, shape1, index); diff --git a/pseudocode/operators/RESCALE.tosac b/pseudocode/operators/RESCALE.tosac index 3ebb8d6..b13a5ad 100644 --- a/pseudocode/operators/RESCALE.tosac +++ b/pseudocode/operators/RESCALE.tosac @@ -44,15 +44,15 @@ for_each(index in shape) { int32_t extended_out_zp = zero_extend<int32_t>(output_zp); result = apply_add_s<int32_t>(result, extended_out_zp); out_t out = static_cast<out_t>(apply_clip_u<i32_t>(result, - minimum_u<out_t>, - maximum_u<out_t>)); + minimum_u<out_t>(), + maximum_u<out_t>())); } else { int32_t extended_out_zp = sign_extend<int32_t>(output_zp); result = apply_add_s<int32_t>(result, extended_out_zp); out_t out = static_cast<out_t>(apply_clip_s<i32_t>(result, - minimum_s<out_t>, - maximum_s<out_t>)); + minimum_s<out_t>(), + maximum_s<out_t>())); } tensor_write<out_t>(output, shape, index, out); } diff --git a/pseudocode/operators/RESIZE.tosac b/pseudocode/operators/RESIZE.tosac index 2a90f5f..96fcacb 100644 --- a/pseudocode/operators/RESIZE.tosac +++ b/pseudocode/operators/RESIZE.tosac @@ -26,8 +26,8 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW, 0 <= c < C) { resize_t dx, dy; resize_t unit_x, unit_y; - unit_x = (is_floating_point(resize_t)) ? 1.0 : scale_x_n; - unit_y = (is_floating_point(resize_t)) ? 1.0 : scale_y_n; + unit_x = (is_floating_point<resize_t>()) ? 1.0 : scale_x_n; + unit_y = (is_floating_point<resize_t>()) ? 1.0 : scale_y_n; int32_t y = oy * scale_y_d + offset_y; int32_t x = ox * scale_x_d + offset_x; @@ -36,7 +36,7 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW, 0 <= c < C) { int16_t ry = y - iy * scale_y_n; // (y % scale_y_n) int16_t rx = x - ix * scale_x_n; // (x % scale_x_n) - if (is_floating_point(resize_t)) { + if (is_floating_point<resize_t>()) { dy = static_cast<resize_t>(ry) / static_cast<resize_t>(scale_y_n); dx = static_cast<resize_t>(rx) / static_cast<resize_t>(scale_x_n); } else { @@ -61,7 +61,7 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW, 0 <= c < C) { tensor_write<out_t>(output, [N,OH,OW,C], [n,oy,ox,c], acc); } else if (mode==NEAREST) { int32_t iy, ix; - if (is_floating_point(resize_t)) { + if (is_floating_point<resize_t>()) { iy = (dy >= 0.5) ? iy1 : iy0; ix = (dx >= 0.5) ? ix1 : ix0; } else { |