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
#![cfg_attr(not(feature = "std"), no_std)]

#[macro_use]
extern crate derive_new;

pub mod config;

#[cfg(feature = "std")]
pub mod data;

#[cfg(feature = "std")]
pub mod optim;

#[cfg(feature = "std")]
pub mod lr_scheduler;

pub mod grad_clipping;
pub mod module;
pub mod nn;
pub mod record;
pub mod tensor;

extern crate alloc;

#[cfg(all(test, not(feature = "test-tch")))]
pub type TestBackend = burn_ndarray::NdArrayBackend<f32>;

#[cfg(all(test, feature = "test-tch"))]
pub type TestBackend = burn_tch::TchBackend<f32>;

#[cfg(feature = "std")]
#[cfg(test)]
pub type TestADBackend = burn_autodiff::ADBackendDecorator<TestBackend>;

/// Type alias for the learning rate.
///
/// LearningRate also implements [learning rate scheduler](crate::lr_scheduler::LRScheduler) so it
/// can be used for constant learning rate.
pub type LearningRate = f64; // We could potentially change the type.