Expand description
Structs and macros used by most projects. Add use burn::prelude::* to your code to quickly get started with
Burn.
Re-exports§
pub use crate::nn;
Macros§
- assert_
shape - Asserts a tensor’s rank, at compile time unless the pattern has
.., and its axis sizes at runtime. - debug_
assert_ shape - Same as
assert_shape!, but compiled out unlessdebug_assertionsis on. - s
- Slice argument constructor for tensor indexing.
Structs§
- Bool
- A type-level representation of the kind of a bool tensor.
- Device
- A high-level device handle for tensor operations.
- Float
- A type-level representation of the kind of a float tensor
- Int
- A type-level representation of the kind of a int tensor.
- Shape
- Shape of a tensor.
- Tensor
- A tensor with a given backend, shape and data type.
- Tensor
Data - Data structure for tensors.
Enums§
- Device
Index - Selector for the hardware index of a backend whose devices are simply indexed (e.g. CUDA, ROCm).
- Device
Kind - Selector for the more flexible backends whose device handle is a tagged enum (e.g. WGPU, which can target a discrete/integrated/virtual GPU, a CPU adapter, an externally-created wgpu setup, or just “best available”).
Traits§
- Config
- Configuration trait.
- Element
Conversion - Element conversion trait for tensor.
- Module
- Trait for all neural network modules.
- Slice
Arg - Trait for slice arguments that can be converted into an array of slices.
This allows the
slicemethod to accept both single slices (froms![..]) and arrays of slices (froms![.., ..]or[0..5, 1..3]). - ToElement
- A generic trait for converting a value to a number. Adapted from num_traits::ToPrimitive to support bool.