hls4ml
hls4ml copied to clipboard
For encoded convolution, add check for when min_width would have been larger than in_width
Description
In the encoded convolution, the case when the in_width is smaller than the nominal min_width needs to be handled as a special case. This attempts to fix this situation. It has been been minimally tested in a conv1d case where in_width = 11 while the kernel width is 9. Additional tests need to be made.
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.
- [x] Bug fix (non-breaking change that fixes an issue)
Tests
test_conv1d_narrow.py
fails in main, but passes after this fix.
Checklist
- [x] I have read the guidelines for contributing.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] My changes generate no new warnings.
- [x] I have added tests that prove my fix is effective or that my feature works.
This has been tested for 1D, and could be merged in the more restricted sense, but it has not been tested for 2D. I think planning should take into account the future of encoded.
I will restrict this PR to the 1D case because I think that's the only one that would be important. If we fix it for 2D, we can make a different PR.
There are some issues still, so I am converting to a draft till I get a chance to look.
This should now also fix the same issue with Conv2D.
@vloncar, are you happy with the changes here as they are?
Is there anything left to do here before it's merged?