diff --git a/crates/burn-autodiff/Cargo.toml b/crates/burn-autodiff/Cargo.toml index 17b87f9d8..49c0b0906 100644 --- a/crates/burn-autodiff/Cargo.toml +++ b/crates/burn-autodiff/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-autodiff" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-autodiff" +documentation = "https://docs.rs/burn-autodiff" version.workspace = true [features] @@ -29,3 +30,7 @@ log = { workspace = true } burn-tensor = { path = "../burn-tensor", version = "0.15.0", default-features = false, features = [ "export_tests", ] } + +[package.metadata.docs.rs] +features = ["default"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-autodiff/src/lib.rs b/crates/burn-autodiff/src/lib.rs index 9ed097b72..fdb3312d8 100644 --- a/crates/burn-autodiff/src/lib.rs +++ b/crates/burn-autodiff/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! # Burn Autodiff //! diff --git a/crates/burn-candle/Cargo.toml b/crates/burn-candle/Cargo.toml index 0d110a096..0abad2905 100644 --- a/crates/burn-candle/Cargo.toml +++ b/crates/burn-candle/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-candle" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-candle" +documentation = "https://docs.rs/burn-candle" version.workspace = true [features] @@ -18,7 +19,6 @@ cuda = ["candle-core/cuda"] metal = ["candle-core/metal"] accelerate = ["candle-core/accelerate"] - [dependencies] derive-new = { workspace = true } burn-tensor = { path = "../burn-tensor", version = "0.15.0", default-features = false } @@ -37,3 +37,4 @@ burn-tensor = { path = "../burn-tensor", version = "0.15.0", default-features = [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-candle/src/lib.rs b/crates/burn-candle/src/lib.rs index c56596bf9..d82440efa 100644 --- a/crates/burn-candle/src/lib.rs +++ b/crates/burn-candle/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![allow(unused)] // TODO remove when backend filled //! Burn Candle Backend diff --git a/crates/burn-common/Cargo.toml b/crates/burn-common/Cargo.toml index cfff5708d..02205f94e 100644 --- a/crates/burn-common/Cargo.toml +++ b/crates/burn-common/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-common" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-common" +documentation = "https://docs.rs/burn-common" version.workspace = true [features] @@ -21,7 +22,6 @@ rayon = ["dep:rayon"] getrandom = { workspace = true, features = ["js"] } web-time = { version = "1.1.0" } - [dependencies] # Network downloader indicatif = { workspace = true, optional = true } @@ -37,3 +37,4 @@ dashmap = { workspace = true } [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-common/src/lib.rs b/crates/burn-common/src/lib.rs index 9d7fc998b..77faa0195 100644 --- a/crates/burn-common/src/lib.rs +++ b/crates/burn-common/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! # Burn Common Library //! diff --git a/crates/burn-core/Cargo.toml b/crates/burn-core/Cargo.toml index 79ae1c582..7c847a90d 100644 --- a/crates/burn-core/Cargo.toml +++ b/crates/burn-core/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-core" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-core" +documentation = "https://docs.rs/burn-core" version.workspace = true [features] @@ -50,6 +51,7 @@ doc = [ "ndarray", "tch", "wgpu", + "cuda-jit", "vision", "autodiff", # Doc features @@ -155,3 +157,4 @@ burn-autodiff = { path = "../burn-autodiff", version = "0.15.0" } [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-core/src/lib.rs b/crates/burn-core/src/lib.rs index de80e8a25..ce118345a 100644 --- a/crates/burn-core/src/lib.rs +++ b/crates/burn-core/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! The core crate of Burn. diff --git a/crates/burn-cuda/Cargo.toml b/crates/burn-cuda/Cargo.toml index a5ebb1147..1f837c78e 100644 --- a/crates/burn-cuda/Cargo.toml +++ b/crates/burn-cuda/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-cuda" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-cuda" +documentation = "https://docs.rs/burn-cuda" version.workspace = true [features] @@ -36,3 +37,4 @@ burn-jit = { path = "../burn-jit", version = "0.15.0", default-features = false, [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-cuda/src/lib.rs b/crates/burn-cuda/src/lib.rs index 23958db2e..a3f9a0218 100644 --- a/crates/burn-cuda/src/lib.rs +++ b/crates/burn-cuda/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + extern crate alloc; use burn_jit::JitBackend; diff --git a/crates/burn-dataset/Cargo.toml b/crates/burn-dataset/Cargo.toml index d2bf8a229..c506eaa99 100644 --- a/crates/burn-dataset/Cargo.toml +++ b/crates/burn-dataset/Cargo.toml @@ -8,21 +8,17 @@ license.workspace = true name = "burn-dataset" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-dataset" +documentation = "https://docs.rs/burn-dataset" version.workspace = true [features] default = ["sqlite-bundled"] doc = ["default"] - audio = ["hound"] - fake = ["dep:fake"] - sqlite = ["__sqlite-shared", "dep:rusqlite"] sqlite-bundled = ["__sqlite-shared", "rusqlite/bundled"] - vision = ["dep:flate2", "dep:globwalk", "dep:burn-common", "dep:image"] - # internal __sqlite-shared = [ "dep:r2d2", @@ -31,7 +27,6 @@ __sqlite-shared = [ "dep:image", "dep:gix-tempfile", ] - dataframe = ["dep:polars"] [dependencies] @@ -72,3 +67,4 @@ normal = ["strum", "strum_macros"] [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-dataset/src/lib.rs b/crates/burn-dataset/src/lib.rs index f514c812f..899ea265c 100644 --- a/crates/burn-dataset/src/lib.rs +++ b/crates/burn-dataset/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! # Burn Dataset //! diff --git a/crates/burn-fusion/Cargo.toml b/crates/burn-fusion/Cargo.toml index e3f74bcce..27b312f49 100644 --- a/crates/burn-fusion/Cargo.toml +++ b/crates/burn-fusion/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-fusion" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-fusion" +documentation = "https://docs.rs/burn-fusion" version.workspace = true [features] @@ -27,3 +28,4 @@ half = { workspace = true } [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-fusion/src/lib.rs b/crates/burn-fusion/src/lib.rs index 1eb1454c7..ee1c3f372 100644 --- a/crates/burn-fusion/src/lib.rs +++ b/crates/burn-fusion/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! # Burn Fusion //! diff --git a/crates/burn-import/Cargo.toml b/crates/burn-import/Cargo.toml index d9000434f..0f7078b19 100644 --- a/crates/burn-import/Cargo.toml +++ b/crates/burn-import/Cargo.toml @@ -9,6 +9,7 @@ license.workspace = true name = "burn-import" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-import" +documentation = "https://docs.rs/burn-import" version.workspace = true default-run = "onnx2burn" @@ -40,3 +41,7 @@ zip = { workspace = true, optional = true } [dev-dependencies] pretty_assertions = { workspace = true } rstest = { workspace = true } + +[package.metadata.docs.rs] +features = ["default"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-import/src/lib.rs b/crates/burn-import/src/lib.rs index 2723d764d..362cf4b0c 100644 --- a/crates/burn-import/src/lib.rs +++ b/crates/burn-import/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![allow(clippy::ptr_arg)] #![allow(clippy::single_match)] #![allow(clippy::upper_case_acronyms)] diff --git a/crates/burn-jit/Cargo.toml b/crates/burn-jit/Cargo.toml index c7538e1d9..b24c1d58f 100644 --- a/crates/burn-jit/Cargo.toml +++ b/crates/burn-jit/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-jit" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-jit" +documentation = "https://docs.rs/burn-jit" version.workspace = true [features] @@ -56,3 +57,4 @@ serial_test = { workspace = true, optional = true } [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-jit/src/lib.rs b/crates/burn-jit/src/lib.rs index 3fcd6e026..fcf69c432 100644 --- a/crates/burn-jit/src/lib.rs +++ b/crates/burn-jit/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! Burn JIT Backend diff --git a/crates/burn-ndarray/Cargo.toml b/crates/burn-ndarray/Cargo.toml index 53a5ebfdb..ef5016d8c 100644 --- a/crates/burn-ndarray/Cargo.toml +++ b/crates/burn-ndarray/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-ndarray" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-ndarray" +documentation = "https://docs.rs/burn-ndarray" version.workspace = true [features] @@ -70,3 +71,4 @@ burn-tensor = { path = "../burn-tensor", version = "0.15.0", default-features = [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-ndarray/src/lib.rs b/crates/burn-ndarray/src/lib.rs index 3784caeb5..c93ac82f1 100644 --- a/crates/burn-ndarray/src/lib.rs +++ b/crates/burn-ndarray/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! Burn ndarray backend. diff --git a/crates/burn-tch/Cargo.toml b/crates/burn-tch/Cargo.toml index c4d0b550e..239b969b4 100644 --- a/crates/burn-tch/Cargo.toml +++ b/crates/burn-tch/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-tch" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-tch" +documentation = "https://docs.rs/burn-tch" version.workspace = true [features] @@ -33,3 +34,4 @@ burn-tensor = { path = "../burn-tensor", version = "0.15.0", default-features = [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-tch/src/lib.rs b/crates/burn-tch/src/lib.rs index c15e98b5c..4d9f146a5 100644 --- a/crates/burn-tch/src/lib.rs +++ b/crates/burn-tch/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![allow(clippy::single_range_in_vec_init)] //! Burn Tch Backend diff --git a/crates/burn-tensor/Cargo.toml b/crates/burn-tensor/Cargo.toml index 7b9eb611a..42e53b9e1 100644 --- a/crates/burn-tensor/Cargo.toml +++ b/crates/burn-tensor/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-tensor" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-tensor" +documentation = "https://docs.rs/burn-tensor" version.workspace = true [features] @@ -53,3 +54,4 @@ rand = { workspace = true, features = ["std", "std_rng"] } # Default enables std [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-tensor/src/lib.rs b/crates/burn-tensor/src/lib.rs index 3d5032b56..98e0a673d 100644 --- a/crates/burn-tensor/src/lib.rs +++ b/crates/burn-tensor/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] // Allow deprecated `Data` and `DataSerialize` #![allow(deprecated)] diff --git a/crates/burn-train/Cargo.toml b/crates/burn-train/Cargo.toml index 73d961295..eedc74f67 100644 --- a/crates/burn-train/Cargo.toml +++ b/crates/burn-train/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-train" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-train" +documentation = "https://docs.rs/burn-train" version.workspace = true [features] @@ -17,7 +18,10 @@ metrics = ["nvml-wrapper", "sysinfo", "systemstat"] tui = ["ratatui", "crossterm"] [dependencies] -burn-core = { path = "../burn-core", version = "0.15.0", features = ["dataset", "std"], default-features = false } +burn-core = { path = "../burn-core", version = "0.15.0", features = [ + "dataset", + "std", +], default-features = false } log = { workspace = true } tracing-subscriber = { workspace = true } @@ -42,3 +46,4 @@ burn-ndarray = { path = "../burn-ndarray", version = "0.15.0" } [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-train/src/lib.rs b/crates/burn-train/src/lib.rs index cb4f39785..23413fa2e 100644 --- a/crates/burn-train/src/lib.rs +++ b/crates/burn-train/src/lib.rs @@ -1,4 +1,5 @@ #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! A library for training neural networks using the burn crate. diff --git a/crates/burn-wgpu/Cargo.toml b/crates/burn-wgpu/Cargo.toml index 4b5f9223a..dab0baa9d 100644 --- a/crates/burn-wgpu/Cargo.toml +++ b/crates/burn-wgpu/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true name = "burn-wgpu" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-wgpu" +documentation = "https://docs.rs/burn-wgpu" version.workspace = true [features] @@ -32,3 +33,7 @@ burn-tensor = { path = "../burn-tensor", version = "0.15.0", features = [ burn-jit = { path = "../burn-jit", version = "0.15.0", default-features = false, features = [ "export_tests", ] } + +[package.metadata.docs.rs] +features = ["default"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn-wgpu/src/lib.rs b/crates/burn-wgpu/src/lib.rs index 8b49ec7e5..40ffdd92d 100644 --- a/crates/burn-wgpu/src/lib.rs +++ b/crates/burn-wgpu/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + extern crate alloc; #[cfg(feature = "template")] diff --git a/crates/burn/Cargo.toml b/crates/burn/Cargo.toml index 70c030247..4927e3989 100644 --- a/crates/burn/Cargo.toml +++ b/crates/burn/Cargo.toml @@ -8,13 +8,14 @@ license.workspace = true name = "burn" readme.workspace = true repository = "https://github.com/tracel-ai/burn" +documentation = "https://docs.rs/burn" version.workspace = true rust-version = "1.80" [features] default = ["burn-core/default", "burn-train?/default", "std"] std = ["burn-core/std"] -doc = ["default", "burn-core/doc", "burn-train/doc"] +doc = ["default", "train", "burn-core/doc", "burn-train/doc"] # Training with full features train = ["burn-train", "autodiff", "dataset"] @@ -69,6 +70,3 @@ record-backward-compat = ["burn-core/record-backward-compat"] burn-core = { path = "../burn-core", version = "0.15.0", default-features = false } burn-train = { path = "../burn-train", version = "0.15.0", optional = true, default-features = false } - -[package.metadata.docs.rs] -features = ["doc"] diff --git a/crates/burn/src/lib.rs b/crates/burn/src/lib.rs index 9f498a1cd..f7448a614 100644 --- a/crates/burn/src/lib.rs +++ b/crates/burn/src/lib.rs @@ -93,6 +93,8 @@ //! - `std`: Activates the standard library (deactivate for no_std) //! - `network`: Enables network utilities (currently, only a file downloader with progress bar) //! - `experimental-named-tensor`: Enables named tensors (experimental) +//! +//! You can also check the details in sub-crates [`burn-core`](https://docs.rs/burn-core) and [`burn-train`](https://docs.rs/burn-train). pub use burn_core::*; diff --git a/crates/onnx-ir/Cargo.toml b/crates/onnx-ir/Cargo.toml index e8cfee51c..0ac9b62fd 100644 --- a/crates/onnx-ir/Cargo.toml +++ b/crates/onnx-ir/Cargo.toml @@ -9,6 +9,7 @@ license.workspace = true name = "onnx-ir" readme.workspace = true repository = "https://github.com/tracel-ai/burn/tree/main/crates/onnx-ir" +documentation = "https://docs.rs/onnx-ir" version.workspace = true diff --git a/examples/mnist/Cargo.toml b/examples/mnist/Cargo.toml index 78ea2bb62..6fefccf1d 100644 --- a/examples/mnist/Cargo.toml +++ b/examples/mnist/Cargo.toml @@ -17,8 +17,8 @@ tch-gpu = ["burn/tch"] wgpu = ["burn/wgpu"] [dependencies] -burn = {path = "../../crates/burn", features=["train"]} +burn = { path = "../../crates/burn", features = ["train"] } # Serialization -log = {workspace = true} -serde = {workspace = true, features = ["std", "derive"]} +log = { workspace = true } +serde = { workspace = true, features = ["std", "derive"] }