From 6b07b531f56bddbf15bf1a65a9810cfc07e2cd72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=A5=87=E5=8F=AF?= Date: Thu, 6 Sep 2018 20:31:25 +0800 Subject: [PATCH] fix resize bicubic code format --- mace/kernels/resize_bicubic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mace/kernels/resize_bicubic.h b/mace/kernels/resize_bicubic.h index 72458041..600796dd 100644 --- a/mace/kernels/resize_bicubic.h +++ b/mace/kernels/resize_bicubic.h @@ -54,7 +54,7 @@ inline const float *GetCoeffsTable() { return coeffs_tab; } -inline int64_t Bound(int64_t val, int64_t limit) { +inline int64_t Bound(const int64_t val, const int64_t limit) { return std::min(limit - 1ll, std::max(0ll, val)); } @@ -79,9 +79,9 @@ inline float Interpolate1D(const std::vector &weights, values[2] * weights[2] + values[3] * weights[3]; } -inline float CalculateResizeScale(index_t in_size, - index_t out_size, - bool align_corners) { +inline float CalculateResizeScale(const index_t in_size, + const index_t out_size, + const bool align_corners) { return (align_corners && out_size > 1) ? (in_size - 1) / static_cast(out_size - 1) : in_size / static_cast(out_size); -- GitLab