1#![cfg_attr(not(feature = "std"), no_std)]
2#![warn(missing_docs)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4
5#[macro_use]
8extern crate derive_new;
9
10extern crate alloc;
11
12mod data;
13pub use data::*;
14
15pub mod distribution;
16pub use distribution::*;
17pub mod element;
18pub use element::*;
19
20pub mod backend;
22pub use backend::*;
23
24pub mod tensor;
26
27pub use burn_std::reader::*; pub use burn_std::{
30 AllocationProperty, BoolDType, BoolStore, Bytes, DType, DeviceHandle, FloatDType, IntDType,
31 bf16, f16, stream_id::StreamId,
32};
33
34pub mod shape {
36 pub use burn_std::shape::*;
37}
38pub use shape::*;
39
40pub mod slice {
42 pub use burn_std::{s, slice::*};
43}
44pub use slice::*;
45
46pub mod indexing {
48 pub use burn_std::indexing::*;
49}
50pub use indexing::*;
51
52pub mod quantization {
54 pub use crate::tensor::quantization::*;
55 pub use burn_std::quantization::{
56 BlockSize, QuantLevel, QuantMode, QuantParam, QuantPropagation, QuantScheme, QuantStore,
57 QuantValue, QuantizedBytes,
58 };
59}
60
61#[cfg(feature = "cubecl-wgpu")]
62mod cube_wgpu {
63 use crate::backend::DeviceOps;
64 use cubecl::wgpu::WgpuDevice;
65
66 impl DeviceOps for WgpuDevice {}
67}
68
69#[cfg(feature = "cubecl-cuda")]
70mod cube_cuda {
71 use crate::backend::DeviceOps;
72 use cubecl::cuda::CudaDevice;
73
74 impl DeviceOps for CudaDevice {}
75}
76
77#[cfg(feature = "cubecl-cpu")]
78mod cube_cpu {
79 use crate::backend::DeviceOps;
80 use cubecl::cpu::CpuDevice;
81
82 impl DeviceOps for CpuDevice {}
83}
84
85#[cfg(feature = "cubecl-hip")]
86mod cube_hip {
87 use crate::backend::DeviceOps;
88 use cubecl::hip::AmdDevice;
89
90 impl DeviceOps for AmdDevice {}
91}
92
93#[macro_export]
102macro_rules! doc_tensor {
103 () => {
104 concat!(
105 "[`Tensor`](https://docs.rs/burn-tensor/",
106 env!("CARGO_PKG_VERSION"),
107 "/burn_tensor/struct.Tensor.html)"
108 )
109 };
110
111 ($method:literal) => {
112 concat!(
113 "[`Tensor::",
114 $method,
115 "`](",
116 "https://docs.rs/burn-tensor/",
117 env!("CARGO_PKG_VERSION"),
118 "/burn_tensor/struct.Tensor.html#method.",
119 $method,
120 ")"
121 )
122 };
123}