Skip to content

Conversation

@nihui
Copy link
Member

@nihui nihui commented Oct 27, 2025

No description provided.

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15208240 15208240 0 😘
armhf 6210540 6210540 0 😘
aarch64 9523592 9523592 0 😘

@nihui nihui requested a review from Copilot October 28, 2025 04:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for the nearest-exact interpolation mode in the PNNX converter. The nearest-exact mode provides an alternative nearest-neighbor interpolation algorithm that differs from the standard nearest mode in how it calculates pixel indices.

Key changes:

  • Added nearest-exact mode handling in PNNX conversion passes for both F.interpolate and nn.Upsample
  • Updated test files with version-gated test cases for PyTorch 1.11+ and 2.9+ (ONNX)
  • Modified float/double formatting in utils.cpp to use %g format specifier

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/pnnx/tests/test_nn_Upsample.py Added version-gated test cases for nearest-exact mode in 1D, 2D, and 3D upsampling
tools/pnnx/tests/test_F_interpolate.py Added version-gated test cases for nearest-exact mode in functional interpolation
tools/pnnx/tests/onnx/test_nn_Upsample.py Added version-gated ONNX test cases for nearest-exact mode with PyTorch 2.9+
tools/pnnx/tests/onnx/test_F_interpolate.py Added version-gated ONNX test cases for nearest-exact mode with PyTorch 2.9+
tools/pnnx/src/utils.cpp Changed float/double formatting from fixed precision to %g format
tools/pnnx/src/pass_ncnn/nn_Upsample.cpp Added handling for nearest-exact mode with stderr warnings
tools/pnnx/src/pass_ncnn/F_interpolate.cpp Added handling for nearest-exact mode with stderr warnings
tools/pnnx/src/pass_level2/F_interpolate.cpp Added graph rewriter passes for nearest-exact interpolation and ONNX conversions
tools/pnnx/src/pass_level1/nn_Upsample.cpp Added detection and parameter setting for nearest-exact upsampling operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui nihui merged commit 27ae758 into Tencent:master Oct 28, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants