Reshape Result is Different from Onnx and TRT if Assignment is Apllied in Model
@zerollzeng is already working on this.
Since Mar 19, 2023.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
When I applied a reshape to a tensor, the result is different from the result in onnx when I assign some value to a empty tensor. To make it clear, I use torch.arange() to reproduce the bug, it seems there will be four number lost in every batch. The detail file and steps is shown below.
Environment
TensorRT Version: 8.5.1.7
NVIDIA GPU: 3090
NVIDIA Driver Version:525.60.11
CUDA Version: 12.0
CUDNN Version: 8.6.0
Operating System: ubuntu 18.04
Python Version (if applicable): 3.7.13
PyTorch Version (if applicable): 1.12.0
Relevant Files
Steps To Reproduce
The file is shown above, there are two .py file in it. The different between bug one and correct one is in line 21, which the bug one has an assignment, but the correct one doesn't. And the two onnx file is in it as well, bug.onnx is generated by bug_model.py and correct.onnx is generated by correct_model.py. The .py files don't rely on anything, you can just run it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.