diff --git a/crates/burn-autodiff/Cargo.toml b/crates/burn-autodiff/Cargo.toml index 17b87f9d87..49c0b09064 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 9ed097b72a..fdb3312d8e 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 0d110a0963..0abad29059 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 c56596bf9e..d82440efa9 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 aa3f44b010..eb0011ba65 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] data-encoding = { workspace = true } @@ -39,3 +39,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 9d7fc998b2..77faa0195d 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 6f2bf49fbe..e1aa112dc6 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] @@ -152,3 +153,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 de80e8a25b..ce118345ad 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 a5ebb11477..1f837c78ef 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 23958db2e4..a3f9a02189 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 d2bf8a229b..c506eaa992 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 f514c812fb..899ea265c6 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 e3f74bcce2..27b312f49a 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 1eb1454c73..ee1c3f3728 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 d9000434f5..0f7078b195 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 2723d764d3..362cf4b0c6 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 42cb1b4425..de1d8522a7 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] @@ -54,3 +55,4 @@ burn-ndarray = { path = "../burn-ndarray", version = "0.15.0", 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 292505845d..3d15ae989d 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 da5b47b00d..f052f2939a 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] @@ -69,3 +70,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 3784caeb5e..c93ac82f1e 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 c4d0b550e0..239b969b4f 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 c15e98b5c3..4d9f146a5d 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 7b9eb611a9..42e53b9e10 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 3d5032b562..98e0a673d0 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 73d9612957..a196796459 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] @@ -42,3 +43,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 cb4f39785a..23413fa2ef 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 b617027fdc..55f0cd6bc3 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] @@ -30,3 +31,7 @@ burn-fusion = { path = "../burn-fusion", version = "0.15.0", optional = true } 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 8b49ec7e50..40ffdd92d7 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 70c030247e..f1403279b2 100644 --- a/crates/burn/Cargo.toml +++ b/crates/burn/Cargo.toml @@ -8,6 +8,7 @@ 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" @@ -72,3 +73,4 @@ burn-train = { path = "../burn-train", version = "0.15.0", optional = true, defa [package.metadata.docs.rs] features = ["doc"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/burn/src/lib.rs b/crates/burn/src/lib.rs index 9f498a1cdf..3f86c331fd 100644 --- a/crates/burn/src/lib.rs +++ b/crates/burn/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 //! diff --git a/crates/onnx-ir/Cargo.toml b/crates/onnx-ir/Cargo.toml index e8cfee51c5..0ac9b62fdb 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