Unsqueeze operator with dynamic inout by apbose · Pull Request #1624 · pytorch/TensorRT (original) (raw)

The PR consists of the following changes-

  1. Change the use_zeroes parameter to false in shuffle_layer->setReshapeDimensions(), else it is resulting in empty tensor
  2. 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.

Checklist: