-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NamedOutput mechanism clarification #140
Comments
Yeah, sorry. "What if the output is just a feature?" is what I intended to write. (Not great at speaking and writing at the same time.) |
Thanks for the clarification @cynthia ! I agree the Basically, the For the case that the output is just a feature, I suppose the feature can be represented by an // 1. Create a model of the computational graph 'C = 0.2 * A + B'.
const constant = builder.constant(0.2);
const A = builder.input('A', operandType);
const B = builder.input('B', operandType);
const C = builder.add(builder.mul(A, constant), B);
const model = builder.createModel({'C': C}); So after computing, the developer can use name "C" to index the output, e.g. by following code const outputs = await compilation.compute(inputs);
// The computed result of [[1, 1], [1, 1]] is in the buffer associated with
// the output operand.
console.log('Output shape: ' + outputs.C.dimensions);
console.log('Output value: ' + outputs.C.buffer); You can try above code in WebNN code editor with webnn-polyfill. Other usages of
|
As discussed in 18 Feb CG call, I'll craft a PR to add specific text into the spec and ask for review. |
via w3ctag/design-reviews#570 (comment)
@cynthia "What if what is output just a feature?" part needs a clarification?
The text was updated successfully, but these errors were encountered: