Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

wasi-nn: minor fixes to documentation, style (#11732)

Andrew Brown56dcd4ed0da4
diff --git a/crates/wasi-nn/examples/classification-example/README.md b/crates/wasi-nn/examples/classification-example/README.md
index 698974c574..018cfe8fe9 100644
--- a/crates/wasi-nn/examples/classification-example/README.md
+++ b/crates/wasi-nn/examples/classification-example/README.md
@@ -4,7 +4,7 @@ This example project demonstrates using the `wasi-nn` API to perform machine
learning (ML) inference. It shows how to collect and use the various parts of a
wasi-nn program:
- an ML __framework__ ("backend" in wasi-nn terms)
-- an ML __model__ ("graph" terms in wasi-nn terms)
+- an ML __model__ ("graph" in wasi-nn terms)
- a WebAssembly __program__
- a wasi-nn-compatible __engine__
@@ -31,7 +31,7 @@ wget https://download.01.org/openvinotoolkit/fixtures/mobilenet/tensor-1x224x224
```
The `.bgr` file is a tensor representation of an image file (more details
-[here]).
+[here]) which is the input to this model, i.e., the image to be classified.
[here]: https://download.01.org/openvinotoolkit/fixtures/mobilenet
diff --git a/crates/wasi-nn/examples/classification-example/src/main.rs b/crates/wasi-nn/examples/classification-example/src/main.rs
index 6b415fb96b..10314c3abb 100644
--- a/crates/wasi-nn/examples/classification-example/src/main.rs
+++ b/crates/wasi-nn/examples/classification-example/src/main.rs
@@ -1,6 +1,5 @@
use std::convert::TryInto;
use std::fs;
-use wasi_nn;
pub fn main() {
let xml = fs::read_to_string("fixture/model.xml").unwrap();
@@ -17,10 +16,10 @@ pub fn main() {
)
.unwrap()
};
- println!("Loaded graph into wasi-nn with ID: {}", graph);
+ println!("Loaded graph into wasi-nn with ID: {graph}");
let context = unsafe { wasi_nn::init_execution_context(graph).unwrap() };
- println!("Created wasi-nn execution context with ID: {}", context);
+ println!("Created wasi-nn execution context with ID: {context}");
// Load a tensor that precisely matches the graph input tensor (see
// `fixture/frozen_inference_graph.xml`).