concision_core/
primitives.rs

1/*
2    Appellation: primitives <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5pub use consts::*;
6
7pub mod consts {
8    /// The default model size for any given model
9    pub const D_MODEL: usize = 512;
10    /// The default epsilon value for floating point operations
11    pub const EPSILON: f64 = 1e-5;
12}
13
14#[allow(unused)]
15pub(crate) mod rust {
16    #[cfg(all(feature = "alloc", no_std))]
17    pub(crate) use self::no_std::*;
18    #[cfg(feature = "std")]
19    pub(crate) use self::with_std::*;
20    pub(crate) use core::*;
21    #[cfg(all(feature = "alloc", no_std))]
22    mod no_std {
23        pub use alloc::borrow::Cow;
24        pub use alloc::boxed::{self, Box};
25        pub use alloc::collections::{self, BTreeMap, BTreeSet, BinaryHeap, VecDeque};
26        pub use alloc::vec::{self, Vec};
27    }
28    #[cfg(feature = "std")]
29    mod with_std {
30        pub use std::borrow::Cow;
31        pub use std::boxed::{self, Box};
32        pub use std::collections::{self, BTreeMap, BTreeSet, BinaryHeap, VecDeque};
33        pub use std::sync::Arc;
34        pub use std::vec::{self, Vec};
35    }
36
37    #[cfg(all(feature = "alloc", no_std))]
38    pub type Map<K, V> = alloc::collections::BTreeMap<K, V>;
39    #[cfg(feature = "std")]
40    pub type Map<K, V> = std::collections::HashMap<K, V>;
41}