Skip to content

Commit 8bd40e2

Browse files
authored
Use names to identify tensors (#61)
Closes #48.
1 parent 5a6ef5b commit 8bd40e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ range from simple to complex (e.g., URLs?) and caching mechanisms of various kin
172172
<h5>Params</h5>
173173
<ul>
174174
<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>
175-
<li><a name="set_input.index"><code>index</code></a>: <code>u32</code></li>
175+
<li><a name="set_input.name"><code>name</code></a>: <code>string</code></li>
176176
<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>
177177
</ul>
178178
<h5>Return values</h5>
@@ -196,7 +196,7 @@ expectation could be removed as a part of https://github.com/WebAssembly/wasi-nn
196196
<h5>Params</h5>
197197
<ul>
198198
<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>
199-
<li><a name="get_output.index"><code>index</code></a>: <code>u32</code></li>
199+
<li><a name="get_output.name"><code>name</code></a>: <code>string</code></li>
200200
</ul>
201201
<h5>Return values</h5>
202202
<ul>

wit/wasi-nn.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ interface inference {
118118
init-execution-context: func(graph: graph) -> result<graph-execution-context, error>;
119119

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

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

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

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

0 commit comments

Comments
 (0)