Commit d2c7873
committed
feat: expose
Add public `sin_cache()` and `cos_cache()` accessors that return the
pre-computed rotary embedding tables. Downstream code that wants to
apply RoPE without going through `RoPE::forward` (for example, a
dispatch that routes the computation to a different operator library)
needs these to reproduce the cached scaling — particularly for
LongRoPE, whose per-dimension short/long factors are non-trivial to
recompute outside this class.
No change to behavior; the new accessors expose the existing buffers
read-only.sin_cache / cos_cache accessors on nn::RoPE
1 parent 3f0a98c commit d2c7873
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| |||
0 commit comments