Skip to content

Commit

Permalink
Fixed typo in the burn book chapter advanced unit no-std. (#2731)
Browse files Browse the repository at this point in the history
* Fixed typo in the burn book chapter advanced unit no-std.

"deice" -> "device"

* Fixed typo in the accompanying example as well.
  • Loading branch information
xmy314 authored Jan 22, 2025
1 parent dd0396d commit e40c69b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit e40c69b

Please sign in to comment.