ml: add the TopK variants and include dropped from eef7952e0
- Commit
317f9e189fcd04a231b58d09646a507f9ebc7eb0- Author
- vayun-mathur <[email protected]>
- When
- 2026-10-26 01:14 UTC (1 month ago)
- Parents
eef7952
Diff
library/ml/src/main/rust/src/nets/mod.rs
diff --git a/library/ml/src/main/rust/src/nets/mod.rs b/library/ml/src/main/rust/src/nets/mod.rsindex d2f6189e02..5ab72470e2 100644--- a/library/ml/src/main/rust/src/nets/mod.rs+++ b/library/ml/src/main/rust/src/nets/mod.rs@@ -325,6 +325,7 @@ pub enum Kind { /// `lo = id % 2048`, `hi = id / 2048`, keeping the FIRST index on ties. /// See `shaders/argmax_fold.comp`. ArgmaxFold,+ TopK, // The 64 largest of a row with their ids; see shaders/topk.comp. /// An [`Act`] applied on its own, for a value no convolution produced. See /// `shaders/activate.comp`. ///
library/ml/src/main/rust/src/nets/mod_part2.rs
diff --git a/library/ml/src/main/rust/src/nets/mod_part2.rs b/library/ml/src/main/rust/src/nets/mod_part2.rsindex f81bff859d..92a6587963 100644--- a/library/ml/src/main/rust/src/nets/mod_part2.rs+++ b/library/ml/src/main/rust/src/nets/mod_part2.rs@@ -348,6 +348,7 @@ pub(crate) enum Node { row: Id, out: Id, },+ TopK { input: Id, row: Id, out: Id, fold: bool }, // See Kind::TopK and Builder::top_k. /// `clamp(round(x / scale), -128, 127) * scale`. See [`Kind::Quantize`]. Quantize { input: Id,
library/ml/src/main/rust/src/nets/reference.rs
diff --git a/library/ml/src/main/rust/src/nets/reference.rs b/library/ml/src/main/rust/src/nets/reference.rsindex f93df72355..d071be54dd 100644--- a/library/ml/src/main/rust/src/nets/reference.rs+++ b/library/ml/src/main/rust/src/nets/reference.rs@@ -172,6 +172,7 @@ include!("reference_part13.rs"); include!("reference_part11.rs"); include!("reference_part3.rs"); include!("reference_part4.rs");+include!("reference_part12.rs"); #[cfg(test)] mod tests { use super::super::{