Repository navigation
Commit c35d0c1
Simplify LinearAttention to single 6-input signature (#226)
Now that onnx-shape-inference >=0.1.9 accepts trailing optional inputs
(matching ONNX C++ behavior), we no longer need per-variant arity
specialization for LinearAttention.
Changes:
- Bump onnx-shape-inference minimum to >=0.1.9
- Declare all 6 inputs (query, key, value, past_state, decay, beta)
unconditionally, using None for unused trailing inputs
- Replace *args unpacking with named parameters in the body function
- Remove the TODO about onnx-shape-inference strict arity check
Call sites that omit trailing inputs (e.g. Mamba2Block with 'gated'
update_rule passing only 5 inputs) now work correctly without needing a
specialized function with fewer formal parameters.
Signed-off-by: G Ramalingam <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent 9e48088 commit c35d0c1
2 files changed
Lines changed: 12 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 129 | + | |
136 | 130 | | |
137 | 131 | | |
138 | 132 | | |
| |||
0 commit comments