pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
83.89k stars 22.61k forks source link

Wrong substitution of aten::to #30226

Open zetyquickly opened 4 years ago

zetyquickly commented 4 years ago

🐛 Bug

The bug takes place when TorchScript scripting is used from eager Python code. ATen::to in resulting TorchScript code has one extra parameter None. Then C++ cannot deal with it

To Reproduce

This comes from an article on discuss:

https://discuss.pytorch.org/t/jit-mobile-wrong-substitution-of-aten-to/60846

Expected behavior

Substitution doesn't contain extra None

Environment

cc @suo

zetyquickly commented 4 years ago

Have anyone met it too?

ljk53 commented 4 years ago

@zetyquickly can you load and run the saved TorchScript model on desktop? Does it only fail when you run on mobile?

zetyquickly commented 4 years ago

@ljk53 Yes, this happens only on mobile. But 1) I haven't tried to load it via libtorch on desktop 2) None parameter is present in function calls in TorchScript code inside .pt archive anyway

dreiss commented 4 years ago

Do you have a script or notebook that we can use to reproduce this issue?