Skip to content

Commit

Permalink
Use names to identify tensors (#61)
Browse files Browse the repository at this point in the history
Closes #48.
  • Loading branch information
abrown authored Nov 9, 2023
1 parent 5a6ef5b commit 8bd40e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ml.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ range from simple to complex (e.g., URLs?) and caching mechanisms of various kin
<h5>Params</h5>
<ul>
<li><a name="set_input.ctx"><code>ctx</code></a>: <a href="#graph_execution_context"><a href="#graph_execution_context"><code>graph-execution-context</code></a></a></li>
<li><a name="set_input.index"><code>index</code></a>: <code>u32</code></li>
<li><a name="set_input.name"><code>name</code></a>: <code>string</code></li>
<li><a name="set_input.tensor"><a href="#tensor"><code>tensor</code></a></a>: <a href="#tensor"><a href="#tensor"><code>tensor</code></a></a></li>
</ul>
<h5>Return values</h5>
Expand All @@ -196,7 +196,7 @@ expectation could be removed as a part of https://github.com/WebAssembly/wasi-nn
<h5>Params</h5>
<ul>
<li><a name="get_output.ctx"><code>ctx</code></a>: <a href="#graph_execution_context"><a href="#graph_execution_context"><code>graph-execution-context</code></a></a></li>
<li><a name="get_output.index"><code>index</code></a>: <code>u32</code></li>
<li><a name="get_output.name"><code>name</code></a>: <code>string</code></li>
</ul>
<h5>Return values</h5>
<ul>
Expand Down
4 changes: 2 additions & 2 deletions wit/wasi-nn.wit
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ interface inference {
init-execution-context: func(graph: graph) -> result<graph-execution-context, error>;

/// Define the inputs to use for inference.
set-input: func(ctx: graph-execution-context, index: u32, tensor: tensor) -> result<_, error>;
set-input: func(ctx: graph-execution-context, name: string, tensor: tensor) -> result<_, error>;

/// Compute the inference on the given inputs.
///
Expand All @@ -127,7 +127,7 @@ interface inference {
compute: func(ctx: graph-execution-context) -> result<_, error>;

/// Extract the outputs after inference.
get-output: func(ctx: graph-execution-context, index: u32) -> result<tensor-data, error>;
get-output: func(ctx: graph-execution-context, name: string) -> result<tensor-data, error>;
}

/// TODO: create function-specific errors (https://github.com/WebAssembly/wasi-nn/issues/42)
Expand Down

0 comments on commit 8bd40e2

Please sign in to comment.