-
Notifications
You must be signed in to change notification settings - Fork 4.3k
implement flip layer and pnnx torch.flip conversion #6233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6233 +/- ##
==========================================
+ Coverage 95.91% 95.96% +0.04%
==========================================
Files 835 836 +1
Lines 264420 264401 -19
==========================================
+ Hits 253631 253738 +107
+ Misses 10789 10663 -126 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The binary size change of libncnn.so (bytes)
|
There was a problem hiding this 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 PR implements the flip layer functionality for ncnn and PNNX, adding support for torch.flip
operation conversion. The implementation includes the core flip layer in ncnn, PNNX conversion passes for both TorchScript and ONNX models, and comprehensive test coverage.
Key changes:
- Added a new
Flip
layer to ncnn that reverses tensor dimensions along specified axes - Implemented PNNX passes to convert
torch.flip
operations from TorchScript and ONNX formats - Added comprehensive test suites for the flip functionality across different tensor dimensions
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/layer/flip.h |
Header file defining the Flip layer class interface |
src/layer/flip.cpp |
Core implementation of the Flip layer with forward pass logic |
tools/pnnx/src/pass_level2/torch_flip.cpp |
PNNX pass for converting torch.flip operations from TorchScript and ONNX |
tools/pnnx/src/pass_ncnn/torch_flip.cpp |
PNNX pass for generating ncnn-compatible flip operations |
tests/test_flip.cpp |
Comprehensive test suite for the flip layer functionality |
Multiple test files | Test scripts for validating torch.flip conversion in different contexts |
Multiple CMakeLists.txt | Build configuration updates to include new flip functionality |
Documentation | Updated operator documentation to include flip layer |
No description provided.