[Model Optimizer] Add conv even -> larger odd kernel #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding to model optimizer/conv.py to allow even-sized convolutions to be implemented with larger odd-size. For example, Conv4x4 is replaced with conv5x5. Only square spatial kernels are supported. Padding is added along the top and left sides of the kernel and input.
Regarding padding, TIDL does not support asymmetric padding on the inputs to Conv layers. Replacing even with next size up odd kernel does require asym padding, so padding is all moved to a preceding, standalone layer, and Conv implements zero-pad 'same' configuration
There is a performance penalty, but this is less drastic than offloading conv operations to CPU as even-sized kernels are not implemented.
I have checked on a model with 4x4 conv that the conv5x5 gives identical output results