aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/image.cc
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2023-07-19 23:08:16 +0000
committerJerry Ge <jerry.ge@arm.com>2023-07-25 22:49:17 +0000
commit9c9c8dafe8f9a32bd70aee268cd537b93865a3ba (patch)
treee94fc471261b9f72bef86033fbc76022f55d5de8 /reference_model/src/ops/image.cc
parentc1e13432b4a218781afd6b0171d4afff11730433 (diff)
downloadreference_model-9c9c8dafe8f9a32bd70aee268cd537b93865a3ba.tar.gz
Run clang-format and update copyright
- Also added run clang-format to pre-commit runs Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I4e59ac0afbaa30dce0773aa63d92a1a3b119e2f3
Diffstat (limited to 'reference_model/src/ops/image.cc')
-rw-r--r--reference_model/src/ops/image.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/reference_model/src/ops/image.cc b/reference_model/src/ops/image.cc
index 575a500..cf2b60a 100644
--- a/reference_model/src/ops/image.cc
+++ b/reference_model/src/ops/image.cc
@@ -24,9 +24,7 @@ using namespace Eigen;
using namespace tosa;
template <TOSA_REF_TYPE InDtype, TOSA_REF_TYPE OutDtype, typename resize_t>
-OpResize<InDtype, OutDtype, resize_t>::OpResize(SubgraphTraverser* sgt_,
- TosaAttributeBase* attribute_,
- uint64_t id_)
+OpResize<InDtype, OutDtype, resize_t>::OpResize(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_)
: GraphNode(sgt_, Op_RESIZE, id_)
{
setRequiredOperands(1, 1);
@@ -134,17 +132,19 @@ int OpResize<InDtype, OutDtype, resize_t>::eval()
// Check Tosa Level
auto tosa_level = g_func_config.tosa_level;
- LEVEL_CHECK(scale_y_n / scale_y_d <= tosa_level.MAX_SCALE, "scale_y_n / scale_y_d should be smaller than or equal to MAX_SCALE");
- LEVEL_CHECK(scale_x_n / scale_x_d <= tosa_level.MAX_SCALE, "scale_x_n / scale_x_d should be smaller than or equal to MAX_SCALE");
+ LEVEL_CHECK(scale_y_n / scale_y_d <= tosa_level.MAX_SCALE,
+ "scale_y_n / scale_y_d should be smaller than or equal to MAX_SCALE");
+ LEVEL_CHECK(scale_x_n / scale_x_d <= tosa_level.MAX_SCALE,
+ "scale_x_n / scale_x_d should be smaller than or equal to MAX_SCALE");
int32_t res_height = 0;
- int32_t res_width = 0;
+ int32_t res_width = 0;
if (idiv_check((in_height - 1) * scale_y_n - offset_y + border_y, scale_y_d, res_height))
- return 1;
+ return 1;
if (idiv_check((in_width - 1) * scale_x_n - offset_x + border_x, scale_x_d, res_width))
- return 1;
+ return 1;
ERROR_IF(out_height != res_height + 1,
"OpResize: mismatch between output height dimension provided and expected shape");
@@ -247,8 +247,10 @@ int OpResize<InDtype, OutDtype, resize_t>::eval()
}
acc = in->getTensor()(b, iy, ix, c);
}
- if ((typeid(resize_t) == typeid(Eigen::bfloat16))) {
- ASSERT_MSG(checkValidBFloat(acc), "Resize accumulator float value is not a valid bfloat16 value.");
+ if ((typeid(resize_t) == typeid(Eigen::bfloat16)))
+ {
+ ASSERT_MSG(checkValidBFloat(acc),
+ "Resize accumulator float value is not a valid bfloat16 value.");
}
out->getTensor()(b, oy, ox, c) = acc;
}