diff --git a/ggml-cuda.cu b/ggml-cuda.cu index 20e3b5efa..5980e29bd 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -6056,7 +6056,7 @@ static __global__ void pool2d_nchw_kernel( const int start_w = cur_ow * sw - pw; const int bw = max(0, start_w); const int ew = min(iw, start_w + kw); - const To scale = 1. / ((eh - bh) * (ew - bw)); + const To scale = 1. / (kh * kw); To res = 0; switch(op){ case GGML_OP_POOL_AVG: res = 0; break; diff --git a/ggml.c b/ggml.c index ccb1bfb5e..ad0a503fd 100644 --- a/ggml.c +++ b/ggml.c @@ -5569,8 +5569,8 @@ struct ggml_tensor * ggml_pool_2d( int k1, int s0, int s1, - float p0, - float p1) { + int p0, + int p1) { bool is_node = false; diff --git a/ggml.h b/ggml.h index cf568b3e5..5a56f73b7 100644 --- a/ggml.h +++ b/ggml.h @@ -1600,8 +1600,8 @@ extern "C" { int k1, int s0, int s1, - float p0, - float p1); + int p0, + int p1); // nearest interpolate // used in stable-diffusion