diff --git a/ml.md b/ml.md index bce656f..c1cd24f 100644 --- a/ml.md +++ b/ml.md @@ -135,38 +135,18 @@ e.g., cannot access a hardware feature requested

The operation failed for an unspecified reason. -

resource error

-
-

Functions

-

[constructor]error: func

-
Params
- -
Return values
- -

[method]error.code: func

-

Return the error code.

-
Params
- -
Return values
- -

[method]error.data: func

-

Errors can propagated with backend specific status through a string value.

-
Params
+

record error

+
Record Fields
-
Return values
-

Import interface wasi:nn/inference@0.2.0-rc-2024-06-25

An inference "session" is encapsulated by a graph-execution-context. This structure binds a @@ -197,7 +177,7 @@ e.g., cannot access a hardware feature requested

Return values

[method]graph-execution-context.compute: func

Compute the inference on the given inputs.

@@ -210,7 +190,7 @@ https://github.com/WebAssembly/wasi-nn/issues/43.

Return values

[method]graph-execution-context.get-output: func

Extract the outputs after inference.

@@ -221,7 +201,7 @@ https://github.com/WebAssembly/wasi-nn/issues/43.

Return values

Import interface wasi:nn/graph@0.2.0-rc-2024-06-25

A graph is a loaded instance of a specific ML model (e.g., MobileNet) for a specific ML @@ -274,7 +254,7 @@ graph IR in parts (e.g., OpenVINO stores its IR and weights separately).

Return values

load: func

Load a graph from an opaque sequence of bytes to use for inference.

@@ -286,7 +266,7 @@ graph IR in parts (e.g., OpenVINO stores its IR and weights separately).

Return values

load-by-name: func

Load a graph by name.

@@ -299,5 +279,5 @@ range from simple to complex (e.g., URLs?) and caching mechanisms of various kin
Return values
diff --git a/wit/wasi-nn.wit b/wit/wasi-nn.wit index 872e8cd..593d6f9 100644 --- a/wit/wasi-nn.wit +++ b/wit/wasi-nn.wit @@ -156,13 +156,12 @@ interface errors { unknown } - resource error { - constructor(code: error-code, data: string); + record error { + /// The error code identifies the general reason the operation failed. + code: error-code, - /// Return the error code. - code: func() -> error-code; - - /// Errors can propagated with backend specific status through a string value. - data: func() -> string; + /// The data field propagates the backend failure context as a string for easier + /// troubleshooting. + data: string, } }