Unsqueeze operator with dynamic inout by apbose · Pull Request #1624 · pytorch/TensorRT (original) (raw)
The PR consists of the following changes-
- Change the use_zeroes parameter to false in shuffle_layer->setReshapeDimensions(), else it is resulting in empty tensor
- Test test_unsqueeze.cpp - to test the above changes
In the case of dynamic inputs eg: [1,-1], the util::unsqueezeDims() was changing the dimension [1,1,0] when value 1 was to be inserted at index 1. In shuffle_layer->setReshapeDimensions(), the 0 in the third dimension causes it to get the dimension from input tensor which has length 0 in that dimension. The use_zeroes parameter is set to false so that [1,-1] is reshaped to [1,1,-1] instead.
Fix for issue 1596.
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