Commit 478acf7
[torchlib] Fix unbind.int if num_outputs=1 (#2684)
This fixes the issue of
```
return [op.Squeeze(out, [dim]) for out in outputs]
^^^^^^^
TypeError: 'SymbolicTensor' object is not iterable
```
when trying to export LSTM modules in `torch`.
This also already appeared in torch issues in
pytorch/pytorch#126339
The core seems to be the changes in #2597.
To my understanding the split returns a single `SymbolicTensor` instead
of a sequence when `dim=1`.
The fix implemented here is the casting of the return type to a list.
I struggled with writing a test that reproduces this nicely in here, any
guidance on that would be welcome.
---------
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>1 parent 971f9bb commit 478acf7
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8957 | 8957 | | |
8958 | 8958 | | |
8959 | 8959 | | |
8960 | | - | |
| 8960 | + | |
| 8961 | + | |
| 8962 | + | |
| 8963 | + | |
| 8964 | + | |
| 8965 | + | |
8961 | 8966 | | |
8962 | 8967 | | |
8963 | 8968 | | |
| |||
0 commit comments