Support Wasi as target (#216)

* Improve features
* Add wasm32-wasi as a target
* Update .github/workflows/ci.yml
Co-authored-by: morenol <22335041+morenol@users.noreply.github.com>
This commit is contained in:
Lorenzo
2022-11-02 15:22:38 +00:00
committed by GitHub
parent b60329ca5d
commit cfbd45bfc0
64 changed files with 583 additions and 150 deletions
+8 -2
View File
@@ -96,7 +96,10 @@ impl<T: RealNumber> Metrics<T> for Recall<T> {
mod tests {
use super::*;
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[cfg_attr(
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test::wasm_bindgen_test
)]
#[test]
fn recall() {
let y_true: Vec<f64> = vec![0., 1., 1., 0.];
@@ -115,7 +118,10 @@ mod tests {
assert!((score3 - 0.6666666666666666).abs() < 1e-8);
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[cfg_attr(
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test::wasm_bindgen_test
)]
#[test]
fn recall_multiclass() {
let y_true: Vec<f64> = vec![0., 0., 0., 1., 1., 1., 2., 2., 2.];