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
32pub type LearningRate = f64; #[cfg(all(
40 test,
41 not(feature = "test-tch"),
42 not(feature = "test-wgpu"),
43 not(feature = "test-cuda"),
44 not(feature = "test-rocm")
45))]
46pub type TestBackend = ruda_tensor_host::Host;
47
48#[cfg(all(test, feature = "test-tch"))]
49pub type TestBackend = ruda_tensor_tch::LibTorch<f32>;
51
52#[cfg(all(test, feature = "test-wgpu"))]
53pub type TestBackend = ruda_tensor_wgpu::Wgpu;
55
56#[cfg(all(test, feature = "test-cuda"))]
57pub type TestBackend = ruda_tensor_device::cuda::Cuda;
59
60#[cfg(all(test, feature = "test-rocm"))]
61pub type TestBackend = ruda_tensor_rocm::Rocm;
63
64#[cfg(test)]
66pub type TestAutodiffBackend = ruda_autodiff::Autodiff<TestBackend>;
67
68#[cfg(all(test, feature = "test-memory-checks"))]
69mod tests {
70 ruda_fusion::memory_checks!();
71}