1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
   Appellation: core <library>
   Contrib: FL03 <jo3mccain@icloud.com>
*/
#![cfg_attr(not(feature = "std"), no_std)]
#![crate_name = "concision_core"]

#[cfg(no_std)]
extern crate alloc;
extern crate ndarray as nd;
#[cfg(feature = "rand")]
extern crate ndarray_rand as ndrand;

pub use self::{error::Error, primitives::*, traits::prelude::*, types::prelude::*, utils::*};

#[cfg(feature = "rand")]
pub use self::rand::prelude::*;

#[macro_use]
pub(crate) mod macros;
pub(crate) mod primitives;
pub(crate) mod utils;

pub mod error;
pub mod func;
pub mod nn;
pub mod ops;
pub mod params;
#[cfg(feature = "rand")]
pub mod rand;
pub mod traits;
pub mod types;

#[allow(unused_imports)]
pub(crate) mod rust {
    pub(crate) use core::*;

    #[cfg(no_std)]
    pub(crate) use self::no_std::*;
    #[cfg(feature = "std")]
    pub(crate) use self::with_std::*;

    #[cfg(no_std)]
    mod no_std {
        pub use alloc::borrow::Cow;
        pub use alloc::boxed::{self, Box};
        pub use alloc::collections::{self, BTreeMap, BTreeSet, BinaryHeap, VecDeque};
        pub use alloc::vec::{self, Vec};
    }
    #[cfg(feature = "std")]
    mod with_std {
        pub use std::borrow::Cow;
        pub use std::boxed::{self, Box};
        pub use std::collections::{self, BTreeMap, BTreeSet, BinaryHeap, VecDeque};
        pub(crate) use std::sync::Arc;
        pub use std::vec::{self, Vec};
    }

    #[cfg(no_std)]
    pub type Map<K, V> = collections::BTreeMap<K, V>;
    #[cfg(feature = "std")]
    pub type Map<K, V> = collections::HashMap<K, V>;
}

pub mod prelude {

    pub use super::primitives::*;
    pub use super::utils::*;

    pub use super::error::prelude::*;
    pub use super::func::prelude::*;
    pub use super::nn::prelude::*;
    pub use super::ops::prelude::*;
    pub use super::params::prelude::*;
    #[cfg(feature = "rand")]
    pub use super::rand::prelude::*;
    pub use super::traits::prelude::*;
    pub use super::types::prelude::*;

    pub(crate) use super::rust::*;
}