Commit 83df7df
authored
Fix {lstm,gru}: slice hidden/cell state with sequence (#2803)
Per the spec, these two fields should be 1D-tensors:
> - starts (heterogeneous) - Tind:
> 1-D tensor of starting indices of corresponding axis in axes
>
> - ends (heterogeneous) - Tind:
> 1-D tensor of ending indices (exclusive) of corresponding axis in axes
With the original code; the output is like this when printing the graph:
```
<snip> int64 val_1 = {1}, int64 val_3 = {0}, <snip>
[node_Slice_5] val_5 = Slice (transpose_1, val_3, val_1, val_4)
[node_Slice_6] val_6 = Slice (transpose_2, val_3, val_1, val_4)
```
With the changes:
```
<snip> int64[1] val_3 = {0}, int64[1] val_4 = {1}, <snip>
[node_Slice_5] val_5 = Slice (transpose_1, val_3, val_4, val_3)
[node_Slice_6] val_6 = Slice (transpose_2, val_3, val_4, val_3)
```
This being scalar was seemingly accepted by the ONNX reference evaluator
and potentially other runtimes, but not in
[tract](https://github.com/sonos/tract).1 parent 5ae26d9 commit 83df7df
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4254 | 4254 | | |
4255 | 4255 | | |
4256 | 4256 | | |
4257 | | - | |
| 4257 | + | |
4258 | 4258 | | |
4259 | 4259 | | |
4260 | 4260 | | |
| |||
5770 | 5770 | | |
5771 | 5771 | | |
5772 | 5772 | | |
5773 | | - | |
5774 | | - | |
| 5773 | + | |
| 5774 | + | |
5775 | 5775 | | |
5776 | 5776 | | |
5777 | 5777 | | |
| |||
0 commit comments