Skip to content

Commit

Permalink
Use proper error handling in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
tynanbe committed Sep 14, 2023
1 parent d538cbc commit 464da52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ pub fn announce_winner(
// The "Horse" Axis size will be inferred based on the data when a Tensor is
// put into our Space (perhaps we won't always know how many horses will run).
//
let assert Ok(d2) =
use d2 <- result.try(
space.d2(Infer(name: "Horse"), Axis(name: "Trial", size: 2))
|> result.map_error(with: tensor.SpaceErrors),
)
// Every Tensor has a numerical Format, a Space, and some data.
// A 2d Tensor can be visualized like a table or matrix.
Expand Down

0 comments on commit 464da52

Please sign in to comment.