1#![cfg_attr(not(feature = "std"), no_std)]
2#![warn(missing_docs)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![recursion_limit = "256"]
5
6#[macro_use]
9extern crate derive_new;
10
11extern crate alloc;
12
13mod optim;
15pub use optim::*;
16
17#[cfg(feature = "fused-adamw")]
19pub mod fused_adamw;
20
21pub mod grad_clipping;
23
24#[cfg(feature = "std")]
26pub mod lr_scheduler;
27
28#[cfg(feature = "std")]
30pub mod training;
31
32#[cfg(feature = "collective")]
34pub mod data_parallel;
35
36pub type LearningRate = f64; #[cfg(all(
44 test,
45 not(feature = "test-tch"),
46 not(feature = "test-wgpu"),
47 not(feature = "test-cuda"),
48 not(feature = "test-rocm")
49))]
50pub type TestBackend = ruda_tensor_host::Host;
51
52#[cfg(all(test, feature = "test-tch"))]
53pub type TestBackend = ruda_tensor_tch::LibTorch<f32>;
55
56#[cfg(all(test, feature = "test-wgpu"))]
57pub type TestBackend = ruda_tensor_wgpu::Wgpu;
59
60#[cfg(all(test, feature = "test-cuda"))]
61pub type TestBackend = ruda_tensor_device::cuda::Cuda;
63
64#[cfg(all(test, feature = "test-rocm"))]
65pub type TestBackend = ruda_tensor_rocm::Rocm;
67
68#[cfg(test)]
70pub type TestAutodiffBackend = ruda_autodiff::Autodiff<TestBackend>;
71
72#[cfg(all(test, feature = "test-memory-checks"))]
73mod tests {
74 ruda_fusion::memory_checks!();
75}