From 8eefb1e413593399fce67ad879be66381e58e68a Mon Sep 17 00:00:00 2001 From: caitianchi Date: Thu, 29 Aug 2024 19:32:38 +0800 Subject: [PATCH] the function "clip" should be int --- examples/llava/clip.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 10e8765b4cd19..9b890571eee9c 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -1623,7 +1623,7 @@ static void normalize_image_u8_to_f32(const clip_image_u8* src, clip_image_f32* } } -inline float clip(float x, float lower, float upper) { +inline int clip(int x, int lower, int upper) { return std::max(lower, std::min(x, upper)); } @@ -1827,10 +1827,6 @@ static std::pair uhd_get_refine_size(std::pair original_size return refine_size; } -inline int clip(int x, int lower, int upper) { - return std::max(lower, std::min(x, upper)); -} - static std::pair uhd_best_grid(const int max_slice_nums, const int multiple, const float log_ratio) { std::vector candidate_split_grids_nums; for (int i : {multiple - 1, multiple, multiple + 1}) {