concision_traits/
lib.rs

1//! Core traits defining fundamental abstractions and operations useful for neural networks.
2//!
3#![crate_type = "lib"]
4#![allow(
5    clippy::missing_safety_doc,
6    clippy::module_inception,
7    clippy::needless_doctest_main,
8    clippy::should_implement_trait,
9    clippy::upper_case_acronyms,
10    rustdoc::redundant_explicit_links
11)]
12#![cfg_attr(not(feature = "std"), no_std)]
13#![cfg_attr(all(feature = "nightly", feature = "alloc"), feature(allocator_api))]
14#![cfg_attr(all(feature = "nightly", feature = "autodiff"), feature(autodiff))]
15// compile-time checks
16#[cfg(not(any(feature = "std", feature = "alloc")))]
17compiler_error! {
18    "At least one of the \"std\" or \"alloc\" features must be enabled for the crate to compile."
19}
20// external crates
21#[cfg(feature = "alloc")]
22extern crate alloc;
23
24#[macro_use]
25pub(crate) mod macros {
26    #[macro_use]
27    pub mod seal;
28}
29
30mod impls {
31    mod impl_backward;
32    mod impl_forward;
33}
34
35mod clip;
36mod codex;
37mod complex;
38mod entropy;
39mod gradient;
40mod init;
41mod loss;
42mod norm;
43mod predict;
44mod propagate;
45mod rounding;
46mod store;
47mod training;
48
49pub mod math {
50    //! Mathematically oriented operators and functions useful in machine learning contexts.
51    #[doc(inline)]
52    pub use self::{linalg::*, percentages::*, roots::*, stats::*, unary::*};
53
54    mod linalg;
55    mod percentages;
56    mod roots;
57    mod stats;
58    mod unary;
59}
60
61pub mod ops {
62    //! composable operators for tensor manipulations and transformations, neural networks, and
63    //! more
64    #[doc(inline)]
65    pub use self::{apply::*, fill::*, like::*, map::*, reshape::*, unary::*};
66
67    mod apply;
68    mod fill;
69    mod like;
70    mod map;
71    mod reshape;
72    mod unary;
73}
74
75pub mod tensor {
76    #[doc(inline)]
77    pub use self::{dimensionality::*, ndtensor::*, tensor_data::*};
78
79    mod dimensionality;
80    mod ndtensor;
81    mod tensor_data;
82}
83
84// re-exports
85#[doc(inline)]
86pub use self::{
87    clip::*, codex::*, complex::*, entropy::*, gradient::*, init::*, loss::*, math::*, norm::*,
88    ops::*, predict::*, propagate::*, rounding::*, store::*, tensor::*, training::*,
89};
90// prelude
91#[doc(hidden)]
92pub mod prelude {
93    pub use crate::clip::*;
94    pub use crate::codex::*;
95    pub use crate::complex::*;
96    pub use crate::entropy::*;
97    pub use crate::gradient::*;
98    pub use crate::init::*;
99    pub use crate::loss::*;
100    pub use crate::math::*;
101    pub use crate::norm::*;
102    pub use crate::ops::*;
103    pub use crate::predict::*;
104    pub use crate::propagate::*;
105    pub use crate::rounding::*;
106    pub use crate::store::*;
107    pub use crate::tensor::*;
108    pub use crate::training::*;
109}