Commit 350a1b1
Fix CRF label_weights: use register_buffer in __init__
Plain attribute assignment in __init__ conflicts with register_buffer()
in set_label_weights() — PyTorch raises KeyError because the attribute
already exists but isn't a buffer. Initialize as a None buffer instead.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent e2acf18 commit 350a1b1
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments