burn_signal/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![warn(missing_docs)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![cfg_attr(feature = "tch", allow(deprecated))]
5
6//! Signal processing operations for Burn tensors.
7//!
8//! No execution backend is enabled by default. Select `flex`, `wgpu`, or another
9//! backend feature on this crate. When configuring through `burn`, enable both
10//! `signal` and the backend feature, for example `features = ["signal", "flex"]`.
11//! Enabling only `burn/flex` does not enable this crate's FFT backend implementation.
12//!
13//! # Migration
14//!
15//! Signal processing previously lived at `burn_tensor::signal` (and therefore
16//! `burn_core::tensor::signal`). Use this crate directly or enable Burn's `signal`
17//! feature for `burn::signal` and the compatibility path `burn::tensor::signal`.
18//! FFTs are backend extensions; windows and STFT/ISTFT compose
19//! tensor operations. Enable `autodiff` to differentiate through FFTs.
20//!
21//! FFT kernels are available for Flex, CubeCL backends, and LibTorch.
22//! The backend features enable native FFT kernels through `burn-flex/fft` or
23//! `burn-cubecl/fft`; these kernels are excluded from the backends' default builds.
24//!
25//! # Remote execution and capture
26//!
27//! FFTs are recorded as custom operations named `signal::rfft` and `signal::irfft`.
28//! Remote servers and interpreters replaying captured graphs must enable `router`
29//! and install `register_fft_ops`
30//! in their custom-operation registry before execution. Pass that registry to
31//! a remote server's `with_custom_ops` or `TensorInterpreter::with_custom_ops`.
32//! Enable `remote` on the client and the concrete backend feature on the server.
33
34extern crate alloc;
35
36mod backends;
37#[cfg(any(feature = "fusion", feature = "router"))]
38mod custom;
39mod functions;
40mod ops;
41
42#[cfg(feature = "router")]
43pub use backends::router::register_fft_ops;
44pub use functions::*;
45pub use ops::SignalOps;