Commit eb909cc
committed
refactor(hpc/activations): convert 3 pub fns to ArrayView-first (W2-2b)
In-place rename. sigmoid_f32 becomes generic-D ArrayView; softmax_f32
and log_softmax_f32 become ArrayView1 (1-D only — softmax_axis variant
deferred to a follow-up). Hot-path as_slice_memory_order dispatch
preserved; cold-path Zip / scalar fallback added.
Tests: contiguous + strided + shape-mismatch coverage per fn (16 tests,
up from 9). Updated burn caller in crates/burn/src/ops/activation.rs
to wrap its &[f32]/&mut [f32] via ArrayView::from / ArrayViewMut::from
at the call site (zero-copy borrow).1 parent 7e7a512 commit eb909cc
2 files changed
Lines changed: 290 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
0 commit comments