models
models copied to clipboard
Add fuse for RepConv
Description
Summary
Add fuse function for RepConv
Motivation and Context
Fuse the multiple conv and bn layer, give me less latency and smaller model size
Dependencies
None
Type of change
For a new feature or function, please create an issue first to discuss it with us before submitting a pull request.
Note: Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation update
- [ ] TensorFlow 2 migration
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] A new research paper code implementation
- [ ] Other (Specify)
Tests
An unit test function is added in official/projects/yolo/modeling/layers/nn_blocks_test.RepConvTest, named test_fuse_and_unfuse_result.
The test function checks the different of the two output values.
Test Configuration:
OS: ubuntu 16 Env:Python=3.10 TensorFlow=2.12.0
Checklist
- [x] I have signed the Contributor License Agreement.
- [x] I have read guidelines for pull request.
- [x] My code follows the coding guidelines.
- [x] I have performed a self code review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [x] I have added tests that prove my fix is effective or that my feature works.