diff options
Diffstat (limited to 'candle-core/src')
-rw-r--r-- | candle-core/src/cpu_backend.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/candle-core/src/cpu_backend.rs b/candle-core/src/cpu_backend.rs index 0ec19559..10c6cc4a 100644 --- a/candle-core/src/cpu_backend.rs +++ b/candle-core/src/cpu_backend.rs @@ -660,6 +660,8 @@ impl Map1 for AvgPool2D { let mut sum = T::zero(); for m in 0..k_h { for n in 0..k_w { + let m = k_h * h_idx + m; + let n = k_w * w_idx + n; sum += src[src_index + m * stride_h + n * stride_w] } } |