Skip to main content

Crate burn_core

Crate burn_core 

Source
Expand description

The core of Burn: modules, configuration, records and data loading, on top of the tensor API.

Applications should depend on burn, which re-exports everything here together with neural network layers, optimizers and training. This crate is the dependency for libraries that only need the core abstractions.

  • tensor: Burn’s tensor API, re-exported from burn-tensor.
  • module: the Module trait, implemented with #[derive(Module)], and Param for trainable tensors.
  • config: serializable configuration structs with #[derive(Config)].
  • store: module records and the burnpack format.
  • data: datasets, batchers and data loaders (std only).
  • prelude: the types most programs import.

§Feature flags

Backend features (wgpu, cuda, flex, …) and the autodiff, fusion, remote and capture features match those of burn. Others:

  • std (default): standard library support. Without it the crate is no_std with alloc.
  • dataset: the dataset library in data; vision, audio and sqlite add sources.
  • network: file downloads with a progress bar.
  • tracing: instrument operations with the tracing crate.

Re-exports§

pub use serde;

Modules§

config
The configuration module.
datastd
Data module.
module
Module for the neural network module.
prelude
Structs and macros used by most projects. Add use burn::prelude::* to your code to quickly get started with Burn.
store
Module for saving and loading module/optimizer state in the burnpack format. Minimal, non-generic record system for saving and loading module parameters.
tensor
Module for the tensor.

Macros§

empty
Constant macro.

Structs§

Tensor
A tensor with a given backend, shape and data type.