diff --git a/mace/kernels/addn.h b/mace/kernels/addn.h index 0803bc2a08b1746174e79271e769b3e0ed32ee96..7538b5b1681e05cdd507277915e9b746461b7d4a 100644 --- a/mace/kernels/addn.h +++ b/mace/kernels/addn.h @@ -19,7 +19,7 @@ namespace mace { namespace kernels { -static constexpr int kCostPerGroup = 1024; +constexpr int kCostPerGroup = 1024; template struct AddNFunctor { diff --git a/mace/kernels/proposal.h b/mace/kernels/proposal.h index d817ae137b9a91498baa68fe0eeac190794e3ca5..0f259cdc3db0e0addcc9ab67540f4d8781eacc97 100644 --- a/mace/kernels/proposal.h +++ b/mace/kernels/proposal.h @@ -15,7 +15,7 @@ namespace mace { namespace kernels { -static inline std::vector WHCenters(const std::vector &anchor) { +inline std::vector WHCenters(const std::vector &anchor) { // width, height, width_center, height_center std::vector window(4); window[0] = anchor[2] - anchor[0] + 1; @@ -25,7 +25,7 @@ static inline std::vector WHCenters(const std::vector &anchor) { return window; } -static inline std::vector> GenerateAnchors( +inline std::vector> GenerateAnchors( const std::vector &scales, const std::vector &ratios, const int base_size) { @@ -65,10 +65,10 @@ static inline std::vector> GenerateAnchors( return anchors; } -static inline std::vector nms(const float *bboxes_ptr, - const index_t num_bboxes, - const float thresh, - const int post_nms_top_n) { +inline std::vector nms(const float *bboxes_ptr, + const index_t num_bboxes, + const float thresh, + const int post_nms_top_n) { std::vector keep; std::vector suppressed(num_bboxes, 0); diff --git a/mace/kernels/resize_bilinear.h b/mace/kernels/resize_bilinear.h index 7af3b39cdb8c3879e12a9517d85493de2aad65d8..5a513753771b9a3153d539a2f49ed819540c7bdc 100644 --- a/mace/kernels/resize_bilinear.h +++ b/mace/kernels/resize_bilinear.h @@ -23,15 +23,15 @@ struct CachedInterpolation { float lerp; }; -static inline float CalculateResizeScale(index_t in_size, - index_t out_size, - bool align_corners) { +inline float CalculateResizeScale(index_t in_size, + index_t out_size, + bool align_corners) { return (align_corners && out_size > 1) ? (in_size - 1) / static_cast(out_size - 1) : in_size / static_cast(out_size); } -static inline void ComputeInterpolationWeights( +inline void ComputeInterpolationWeights( const index_t out_size, const index_t in_size, const float scale, @@ -46,12 +46,12 @@ static inline void ComputeInterpolationWeights( } } -static inline float ComputeLerp(const float top_left, - const float top_right, - const float bottom_left, - const float bottom_right, - const float x_lerp, - const float y_lerp) { +inline float ComputeLerp(const float top_left, + const float top_right, + const float bottom_left, + const float bottom_right, + const float x_lerp, + const float y_lerp) { const float top = top_left + (top_right - top_left) * x_lerp; const float bottom = bottom_left + (bottom_right - bottom_left) * x_lerp; return top + (bottom - top) * y_lerp;