Skip to main content

axonml_core/
lib.rs

1//! Axonml Core - Foundation Layer for the Axonml ML Framework
2//!
3//! # File
4//! `crates/axonml-core/src/lib.rs`
5//!
6//! # Author
7//! Andrew Jewell Sr - AutomataNexus
8//!
9//! # Updated
10//! March 8, 2026
11//!
12//! # Disclaimer
13//! Use at own risk. This software is provided "as is", without warranty of any
14//! kind, express or implied. The author and AutomataNexus shall not be held
15//! liable for any damages arising from the use of this software.
16
17#![cfg_attr(not(feature = "std"), no_std)]
18#![warn(missing_docs)]
19#![warn(clippy::all)]
20#![warn(clippy::pedantic)]
21// ML/tensor-specific allowances
22#![allow(clippy::cast_possible_truncation)]
23#![allow(clippy::cast_sign_loss)]
24#![allow(clippy::cast_precision_loss)]
25#![allow(clippy::cast_possible_wrap)]
26#![allow(clippy::missing_errors_doc)]
27#![allow(clippy::missing_panics_doc)]
28#![allow(clippy::must_use_candidate)]
29#![allow(clippy::module_name_repetitions)]
30#![allow(clippy::similar_names)]
31#![allow(clippy::many_single_char_names)]
32#![allow(clippy::too_many_arguments)]
33#![allow(clippy::doc_markdown)]
34#![allow(clippy::cast_lossless)]
35#![allow(clippy::needless_pass_by_value)]
36#![allow(clippy::redundant_closure_for_method_calls)]
37#![allow(clippy::uninlined_format_args)]
38#![allow(clippy::ptr_arg)]
39#![allow(clippy::return_self_not_must_use)]
40#![allow(clippy::not_unsafe_ptr_arg_deref)]
41#![allow(clippy::items_after_statements)]
42#![allow(clippy::unreadable_literal)]
43#![allow(clippy::if_same_then_else)]
44#![allow(clippy::needless_range_loop)]
45#![allow(clippy::trivially_copy_pass_by_ref)]
46#![allow(clippy::unnecessary_wraps)]
47#![allow(clippy::match_same_arms)]
48#![allow(clippy::unused_self)]
49#![allow(clippy::too_many_lines)]
50#![allow(clippy::single_match_else)]
51#![allow(clippy::fn_params_excessive_bools)]
52#![allow(clippy::struct_excessive_bools)]
53#![allow(clippy::format_push_string)]
54#![allow(clippy::erasing_op)]
55#![allow(clippy::type_repetition_in_bounds)]
56#![allow(clippy::iter_without_into_iter)]
57#![allow(clippy::should_implement_trait)]
58#![allow(clippy::use_debug)]
59#![allow(clippy::case_sensitive_file_extension_comparisons)]
60#![allow(clippy::large_enum_variant)]
61#![allow(clippy::panic)]
62#![allow(clippy::struct_field_names)]
63#![allow(clippy::missing_fields_in_debug)]
64#![allow(clippy::upper_case_acronyms)]
65#![allow(clippy::assigning_clones)]
66#![allow(clippy::option_if_let_else)]
67#![allow(clippy::manual_let_else)]
68#![allow(clippy::explicit_iter_loop)]
69#![allow(clippy::default_trait_access)]
70#![allow(clippy::only_used_in_recursion)]
71#![allow(clippy::manual_clamp)]
72#![allow(clippy::ref_option)]
73#![allow(clippy::multiple_bound_locations)]
74#![allow(clippy::comparison_chain)]
75#![allow(clippy::manual_assert)]
76#![allow(clippy::unnecessary_debug_formatting)]
77
78// =============================================================================
79// Modules
80// =============================================================================
81
82pub mod allocator;
83pub mod backends;
84pub mod device;
85pub mod dtype;
86pub mod error;
87pub mod storage;
88
89// =============================================================================
90// Re-exports
91// =============================================================================
92
93pub use allocator::{Allocator, DefaultAllocator};
94pub use device::Device;
95pub use dtype::{DType, Float, Numeric, Scalar};
96pub use error::{Error, Result};
97pub use storage::Storage;
98
99// =============================================================================
100// Prelude
101// =============================================================================
102
103/// Convenient imports for common usage.
104pub mod prelude {
105    pub use crate::device::Device;
106    pub use crate::dtype::{DType, Float, Numeric, Scalar};
107    pub use crate::error::{Error, Result};
108    pub use crate::storage::Storage;
109}