Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'

This commit is contained in:
ruv
2026-02-28 14:39:40 -05:00
7854 changed files with 3522914 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
use wasm_bindgen::prelude::*;
pub mod attention;
pub mod training;
pub mod utils;
/// Initialize the WASM module with panic hook
#[wasm_bindgen(start)]
pub fn init() {
#[cfg(feature = "console_error_panic_hook")]
console_error_panic_hook::set_once();
}
/// Get the version of the ruvector-attention-wasm crate
#[wasm_bindgen]
pub fn version() -> String {
env!("CARGO_PKG_VERSION").to_string()
}
/// Get information about available attention mechanisms
#[wasm_bindgen]
pub fn available_mechanisms() -> JsValue {
let mechanisms = vec![
"scaled_dot_product",
"multi_head",
"hyperbolic",
"linear",
"flash",
"local_global",
"moe",
];
serde_wasm_bindgen::to_value(&mechanisms).unwrap()
}