[fix] Disambiguate element-wise cast layer names by mfeliz-cruise · Pull Request #1630 · pytorch/TensorRT (original) (raw)
Duplicate layer names in TRT cause an error. Cast layers by default are named based on the Tensor pointer initial type and target type. This could cause name conflicts with multiple element-wise operations that performed the same type promotion on a given tensor. To resolve this, add the element_wise layer name to the type-promotion cast layer as a prefix.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
Checklist:
- My code follows the style guidelines of this project (You can use the linters)
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas and hacks
- I have made corresponding changes to the documentation
- I have added tests to verify my fix or my feature
- New and existing unit tests pass locally with my changes
- I have added the relevant labels to my PR in so that relevant reviewers are notified