Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo in the burn book chapter advanced unit no-std. #2731

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions burn-book/src/advanced/no-std.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ We are using ndarray, so we just need to define the NdArray backend as usual
use burn::{backend::NdArray, tensor::Tensor};

type Backend = NdArray<f32>;
type BackendDeice = <Backend as burn::tensor::backend::Backend>::Device;
type BackendDevice = <Backend as burn::tensor::backend::Backend>::Device;
```

Then inside the `main` function add
```rs
use your_model::Model;

// Get a default device for the backend
let device = BackendDeice::default();
let device = BackendDevice::default();

// Create a new model and load the state
let model: Model<Backend> = Model::default();
Expand Down
6 changes: 3 additions & 3 deletions examples/raspberry-pi-pico/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use embassy_rp as _;
use embedded_alloc::Heap;

type Backend = NdArray<f32>;
type BackendDeice = <Backend as burn::tensor::backend::Backend>::Device;
type BackendDevice = <Backend as burn::tensor::backend::Backend>::Device;

#[global_allocator]
static HEAP: Heap = Heap::empty();
Expand All @@ -25,7 +25,7 @@ async fn main(_spawner: Spawner) {
}

// Get a default device for the backend
let device = BackendDeice::default();
let device = BackendDevice::default();

// Create a new model and load the state
let model: Model<Backend> = Model::default();
Expand All @@ -47,7 +47,7 @@ async fn main(_spawner: Spawner) {
}
}

fn run_model<'a>(model: &Model<NdArray>, device: &BackendDeice, input: f32) -> Tensor<Backend, 2> {
fn run_model<'a>(model: &Model<NdArray>, device: &BackendDevice, input: f32) -> Tensor<Backend, 2> {
// Define the tensor
let input = Tensor::<Backend, 2>::from_floats([[input]], &device);

Expand Down
Loading