I think in order to ensure the accuracy of the model, rounding is necessary.
```
diff --git a/include/tvm/topi/nn/pooling.h b/include/tvm/topi/nn/pooling.h
index c81c7cda7..467d2f5d8 100644
--- a/include/tvm/topi/nn/pooling.h
+++ b/include/tvm/topi/nn/pooling.h
@@ -386,7 +386,7 @@ inline Tensor adaptive_pool_impl(const Tensor& x, const 
Array<PrimExpr>& output_
             divide_factor *= tvm::cast(x->dtype, reduce_axes[i]->dom->extent);
           }
 
-          return div(pool_sum(indices), divide_factor);
+          return div(pool_sum(indices) + div(divide_factor, 2), divide_factor);
         },
         "tensor", kElementWise);
   } else {
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/pytorch-the-inference-results-of-tvm-and-pytorch-are-inconsistent/12048/3)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/fcebcc38d59935420be72541572296eff23346c0e9c3de151d61b7f41c6195c3).

Reply via email to