Skip to content

Commit d646417

Browse files
nathanielsimardsyl20bnr
authored andcommitted
Fix docs (#1229)
1 parent 23d653a commit d646417

File tree

5 files changed

+43
-17
lines changed

5 files changed

+43
-17
lines changed

burn-autodiff/Cargo.toml

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/tracel-ai/burn/tree/main/burn-autodiff"
1111
version.workspace = true
1212

1313
[features]
14-
default = ["export_tests"]
14+
default = []
1515
export_tests = ["burn-tensor-testgen"]
1616

1717
[dependencies]
@@ -21,3 +21,10 @@ burn-tensor-testgen = { path = "../burn-tensor-testgen", version = "0.12.1", opt
2121

2222
derive-new = { workspace = true }
2323
spin = { workspace = true }
24+
25+
[dev-dependencies]
26+
burn-tensor = { path = "../burn-tensor", version = "0.12.1", default-features = false, features = [
27+
"export_tests",
28+
] }
29+
30+

burn-core/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ std = [
4040
]
4141
doc = [
4242
"std",
43+
# Backends
44+
"dataset",
45+
"candle",
46+
"fusion",
47+
"ndarray",
48+
"tch",
49+
"wgpu",
50+
"vision",
51+
"autodiff",
52+
# Doc features
4353
"burn-candle/doc",
4454
"burn-common/doc",
4555
"burn-dataset/doc",

burn-ndarray/Cargo.toml

+10-6
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,9 @@ blas-openblas-system = [
4848

4949
# ** Please make sure all dependencies support no_std when std is disabled **
5050

51-
burn-autodiff = { path = "../burn-autodiff", version = "0.12.1", features = [
52-
"export_tests",
53-
], optional = true }
51+
burn-autodiff = { path = "../burn-autodiff", version = "0.12.1", optional = true }
5452
burn-common = { path = "../burn-common", version = "0.12.1", default-features = false }
55-
burn-tensor = { path = "../burn-tensor", version = "0.12.1", default-features = false, features = [
56-
"export_tests",
57-
] }
53+
burn-tensor = { path = "../burn-tensor", version = "0.12.1", default-features = false }
5854

5955
matrixmultiply = { workspace = true, default-features = false }
6056
rayon = { workspace = true, optional = true }
@@ -67,5 +63,13 @@ openblas-src = { workspace = true, optional = true }
6763
rand = { workspace = true }
6864
spin = { workspace = true } # using in place of use std::sync::Mutex;
6965

66+
[dev-dependencies]
67+
burn-autodiff = { path = "../burn-autodiff", version = "0.12.1", default-features = false, features = [
68+
"export_tests",
69+
] }
70+
burn-tensor = { path = "../burn-tensor", version = "0.12.1", default-features = false, features = [
71+
"export_tests",
72+
] }
73+
7074
[package.metadata.docs.rs]
7175
features = ["doc"]

burn-tensor/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod tensor;
1616
mod tests;
1717

1818
pub use half::{bf16, f16};
19+
pub(crate) use tensor::check::macros::check;
1920
pub use tensor::*;
2021

2122
pub use burn_common::reader::Reader; // Useful so that backends don't have to add `burn_common` as

burn-tensor/src/tensor/api/check.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -818,21 +818,25 @@ impl TensorError {
818818
}
819819
}
820820

821-
/// We use a macro for all checks, since the panic message file and line number will match the
822-
/// function that does the check instead of a the generic error.rs crate private unrelated file
823-
/// and line number.
824-
#[macro_export(local_inner_macros)]
825-
macro_rules! check {
826-
($check:expr) => {
827-
if let TensorCheck::Failed(check) = $check {
828-
core::panic!("{}", check.format());
829-
}
830-
};
821+
/// Module where we defined macros that can be used only in the project.
822+
pub(crate) mod macros {
823+
/// We use a macro for all checks, since the panic message file and line number will match the
824+
/// function that does the check instead of a the generic error.rs crate private unrelated file
825+
/// and line number.
826+
macro_rules! check {
827+
($check:expr) => {
828+
if let TensorCheck::Failed(check) = $check {
829+
core::panic!("{}", check.format());
830+
}
831+
};
832+
}
833+
pub(crate) use check;
831834
}
832835

833836
#[cfg(test)]
834837
mod tests {
835838
use super::*;
839+
use macros::check;
836840

837841
#[test]
838842
#[should_panic]

0 commit comments

Comments
 (0)