Skip to content

Commit 9c00ed6

Browse files
committed
tiling: fix edge case
1 parent 21fc3f0 commit 9c00ed6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml_extend.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ __STATIC_INLINE__ void sd_tiling(ggml_tensor* input, ggml_tensor* output, const
767767

768768
float tile_overlap_factor_x = (float)(input_tile_size * num_tiles_x - input_width) / (float)(input_tile_size * (num_tiles_x - 1));
769769
if (num_tiles_x <= 2) {
770-
if (input_width == input_tile_size) {
770+
if (input_width <= input_tile_size) {
771771
num_tiles_x = 1;
772772
tile_overlap_factor_x = 0;
773773
} else {
@@ -787,7 +787,7 @@ __STATIC_INLINE__ void sd_tiling(ggml_tensor* input, ggml_tensor* output, const
787787

788788
float tile_overlap_factor_y = (float)(input_tile_size * num_tiles_y - input_height) / (float)(input_tile_size * (num_tiles_y - 1));
789789
if (num_tiles_y <= 2) {
790-
if (input_height == input_tile_size) {
790+
if (input_height <= input_tile_size) {
791791
num_tiles_y = 1;
792792
tile_overlap_factor_y = 0;
793793
} else {

0 commit comments

Comments
 (0)