Skip to content

Commit 92dacda

Browse files
Merge pull request #806 from inexorabletash/otherwise-tweaks
SHA: 751ca31 Reason: push, by huningxin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 5960c3a commit 92dacda

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

index.html

+12-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet">
88
<meta content="Bikeshed version c67c745b1, updated Fri Jan 17 14:27:28 2025 -0800" name="generator">
99
<link href="https://www.w3.org/TR/webnn/" rel="canonical">
10-
<meta content="5f85e73d3f25be21ae69bc6efc7b49db673ad066" name="revision">
10+
<meta content="751ca310bcefc98876dc7780413286a553497908" name="revision">
1111
<meta content="dark light" name="color-scheme">
1212
<link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css">
1313
<style>
@@ -1018,7 +1018,7 @@
10181018
<div class="head">
10191019
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p>
10201020
<h1 class="p-name no-ref" id="title">Web Neural Network API</h1>
1021-
<p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2025-01-23">23 January 2025</time></p>
1021+
<p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2025-01-27">27 January 2025</time></p>
10221022
<details open>
10231023
<summary>More details about this document</summary>
10241024
<div data-fill-with="spec-metadata">
@@ -1070,7 +1070,6 @@ <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content"
10701070
patent which the individual believes contains <a href="https://www.w3.org/policies/patent-policy/#def-essential">Essential
10711071
Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/policies/patent-policy/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. </p>
10721072
<p> This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p>
1073-
<p></p>
10741073
<p> Since the <a href="https://www.w3.org/TR/2023/CR-webnn-20230330/">initial Candidate Recommendation Snapshot</a> the Working Group has gathered further <a href="https://webmachinelearning.github.io/webnn-status/">implementation experience</a> and added new operations and data types needed for well-known <a href="https://github.com/webmachinelearning/webnn/issues/375">transformers to support generative AI use cases</a>. In addition, informed by this implementation experience, the group removed <code>MLCommandEncoder</code>, support for synchronous execution, and higher-level operations that can be expressed in terms of lower-level primitives in a performant manner. The group has also updated the specification to use modern authoring conventions to improve interoperability and precision of normative definitions.
10751074
The group is developing a new feature, a <a href="https://github.com/webmachinelearning/webnn/issues/482">backend-agnostic storage type</a>, to improve performance and interoperability between the WebNN, WebGPU APIs and purpose-built hardware for ML and expects to republish this document as a Candidate Recommendation Snapshot when ready for implementation.
10761075
This document is maintained and
@@ -1682,9 +1681,13 @@ <h4 class="heading settled" data-level="7.2.2" id="api-ml-createcontext"><span c
16821681
<li data-md>
16831682
<p>Set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-lost-slot" id="ref-for-dom-mlcontext-lost-slot">[[lost]]</a></code> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise">a new promise</a>.</p>
16841683
<li data-md>
1685-
<p>If <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-devicetype" id="ref-for-dom-mlcontextoptions-devicetype①">deviceType</a></code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists">exists</a>, then set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-devicetype-slot" id="ref-for-dom-mlcontext-devicetype-slot①">[[deviceType]]</a></code> to <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-devicetype" id="ref-for-dom-mlcontextoptions-devicetype②">deviceType</a></code>"]. Otherwise, set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-devicetype-slot" id="ref-for-dom-mlcontext-devicetype-slot②">[[deviceType]]</a></code> to <code class="idl"><a data-link-type="idl" href="#dom-mldevicetype-cpu" id="ref-for-dom-mldevicetype-cpu②">"cpu"</a></code>.</p>
1684+
<p>If <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-devicetype" id="ref-for-dom-mlcontextoptions-devicetype①">deviceType</a></code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists">exists</a>, then set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-devicetype-slot" id="ref-for-dom-mlcontext-devicetype-slot①">[[deviceType]]</a></code> to <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-devicetype" id="ref-for-dom-mlcontextoptions-devicetype②">deviceType</a></code>"].</p>
16861685
<li data-md>
1687-
<p>If <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-powerpreference" id="ref-for-dom-mlcontextoptions-powerpreference①">powerPreference</a></code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists①">exists</a>, then set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-powerpreference-slot" id="ref-for-dom-mlcontext-powerpreference-slot①">[[powerPreference]]</a></code> to <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-powerpreference" id="ref-for-dom-mlcontextoptions-powerpreference②">powerPreference</a></code>"]. Otherwise, set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-powerpreference-slot" id="ref-for-dom-mlcontext-powerpreference-slot②">[[powerPreference]]</a></code> to <code class="idl"><a data-link-type="idl" href="#dom-mlpowerpreference-default" id="ref-for-dom-mlpowerpreference-default②">"default"</a></code>.</p>
1686+
<p>Otherwise, set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-devicetype-slot" id="ref-for-dom-mlcontext-devicetype-slot②">[[deviceType]]</a></code> to <code class="idl"><a data-link-type="idl" href="#dom-mldevicetype-cpu" id="ref-for-dom-mldevicetype-cpu②">"cpu"</a></code>.</p>
1687+
<li data-md>
1688+
<p>If <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-powerpreference" id="ref-for-dom-mlcontextoptions-powerpreference①">powerPreference</a></code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists①">exists</a>, then set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-powerpreference-slot" id="ref-for-dom-mlcontext-powerpreference-slot①">[[powerPreference]]</a></code> to <var>options</var>["<code class="idl"><a data-link-type="idl" href="#dom-mlcontextoptions-powerpreference" id="ref-for-dom-mlcontextoptions-powerpreference②">powerPreference</a></code>"].</p>
1689+
<li data-md>
1690+
<p>Otherwise, set <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-powerpreference-slot" id="ref-for-dom-mlcontext-powerpreference-slot②">[[powerPreference]]</a></code> to <code class="idl"><a data-link-type="idl" href="#dom-mlpowerpreference-default" id="ref-for-dom-mlpowerpreference-default②">"default"</a></code>.</p>
16881691
</ol>
16891692
<li data-md>
16901693
<p>If the user agent cannot support <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-contexttype-slot" id="ref-for-dom-mlcontext-contexttype-slot②">[[contextType]]</a></code>, <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-devicetype-slot" id="ref-for-dom-mlcontext-devicetype-slot③">[[deviceType]]</a></code> and <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlcontext-powerpreference-slot" id="ref-for-dom-mlcontext-powerpreference-slot③">[[powerPreference]]</a></code>, return failure.</p>
@@ -8362,9 +8365,9 @@ <h4 class="heading settled" data-level="7.9.32" id="api-mlgraphbuilder-pool2d"><
83628365
<li data-md>
83638366
<p>If <var>input</var>’s <a data-link-type="dfn" href="#mloperand-rank" id="ref-for-mloperand-rank⑤④">rank</a> is not 4, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw②⑧③">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②⓪④">TypeError</a></code>.</p>
83648367
<li data-md>
8365-
<p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions①">windowDimensions</a></code> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑧⑤">exists</a> and its <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size③⓪">size</a> is not 2, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw②⑧④">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②⓪⑤">TypeError</a></code>.</p>
8368+
<p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions①">windowDimensions</a></code> does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑧⑤">exist</a>, set <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions②">windowDimensions</a></code> to the height and width dimensions of the shape of <var>input</var>.</p>
83668369
<li data-md>
8367-
<p>Otherwise, set <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions">windowDimensions</a></code> to the height and width dimensions of the shape of <var>input</var>.</p>
8370+
<p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions">windowDimensions</a></code>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size③⓪">size</a> is not 2, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw②⑧④">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②⓪⑤">TypeError</a></code>.</p>
83688371
<li data-md>
83698372
<p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-outputsizes" id="ref-for-dom-mlpool2doptions-outputsizes①">outputSizes</a></code> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑧⑥">exists</a>, or if <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-padding" id="ref-for-dom-mlpool2doptions-padding①">padding</a></code> does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑧⑦">exist</a>, set <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-padding" id="ref-for-dom-mlpool2doptions-padding②">padding</a></code> to the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③⑤">list</a> « 0, 0, 0, 0 ».</p>
83708373
<li data-md>
@@ -8392,7 +8395,7 @@ <h4 class="heading settled" data-level="7.9.32" id="api-mlgraphbuilder-pool2d"><
83928395
<li data-md>
83938396
<p>Let <var>desc</var> be a copy of <var>input</var>.<code class="idl"><a data-link-type="idl" href="#dom-mloperand-descriptor-slot" id="ref-for-dom-mloperand-descriptor-slot⑨">[[descriptor]]</a></code>.</p>
83948397
<li data-md>
8395-
<p>Let <var>outputShape</var> be the result of <a data-link-type="dfn" href="#mlgraphbuilder-calculate-pool2d-output-sizes" id="ref-for-mlgraphbuilder-calculate-pool2d-output-sizes">calculating pool2d output sizes</a> given <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-layout" id="ref-for-dom-mlpool2doptions-layout①">layout</a></code>, <var>input</var>’s <a data-link-type="dfn" href="#mloperand-shape" id="ref-for-mloperand-shape⑦⑨">shape</a>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-roundingtype" id="ref-for-dom-mlpool2doptions-roundingtype②">roundingType</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions③">windowDimensions</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-padding" id="ref-for-dom-mlpool2doptions-padding④">padding</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-strides" id="ref-for-dom-mlpool2doptions-strides⑥">strides</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-dilations" id="ref-for-dom-mlpool2doptions-dilations⑤">dilations</a></code>, and <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-outputsizes" id="ref-for-dom-mlpool2doptions-outputsizes③">outputSizes</a></code> (if it <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑨①">exists</a>).</p>
8398+
<p>Let <var>outputShape</var> be the result of <a data-link-type="dfn" href="#mlgraphbuilder-calculate-pool2d-output-sizes" id="ref-for-mlgraphbuilder-calculate-pool2d-output-sizes">calculating pool2d output sizes</a> given <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-layout" id="ref-for-dom-mlpool2doptions-layout①">layout</a></code>, <var>input</var>’s <a data-link-type="dfn" href="#mloperand-shape" id="ref-for-mloperand-shape⑦⑨">shape</a>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-roundingtype" id="ref-for-dom-mlpool2doptions-roundingtype②">roundingType</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-windowdimensions" id="ref-for-dom-mlpool2doptions-windowdimensions④">windowDimensions</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-padding" id="ref-for-dom-mlpool2doptions-padding④">padding</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-strides" id="ref-for-dom-mlpool2doptions-strides⑥">strides</a></code>, <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-dilations" id="ref-for-dom-mlpool2doptions-dilations⑤">dilations</a></code>, and <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-mlpool2doptions-outputsizes" id="ref-for-dom-mlpool2doptions-outputsizes③">outputSizes</a></code> (if it <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists⑨①">exists</a>).</p>
83968399
<li data-md>
83978400
<p>If any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑧">item</a> in <var>outputShape</var> is not a <a data-link-type="dfn" href="#valid-dimension" id="ref-for-valid-dimension①③">valid dimension</a>, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw②⑨②">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②①③">TypeError</a></code>.</p>
83988401
<li data-md>
@@ -13607,7 +13610,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
1360713610
"dom-mlpool2doptions-padding": {"dfnID":"dom-mlpool2doptions-padding","dfnText":"padding","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpool2doptions-padding"},{"id":"ref-for-dom-mlpool2doptions-padding\u2460"},{"id":"ref-for-dom-mlpool2doptions-padding\u2461"},{"id":"ref-for-dom-mlpool2doptions-padding\u2462"},{"id":"ref-for-dom-mlpool2doptions-padding\u2463"}],"title":"7.9.32. Pooling operations"}],"url":"#dom-mlpool2doptions-padding"},
1360813611
"dom-mlpool2doptions-roundingtype": {"dfnID":"dom-mlpool2doptions-roundingtype","dfnText":"roundingType","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpool2doptions-roundingtype"},{"id":"ref-for-dom-mlpool2doptions-roundingtype\u2460"},{"id":"ref-for-dom-mlpool2doptions-roundingtype\u2461"}],"title":"7.9.32. Pooling operations"}],"url":"#dom-mlpool2doptions-roundingtype"},
1360913612
"dom-mlpool2doptions-strides": {"dfnID":"dom-mlpool2doptions-strides","dfnText":"strides","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpool2doptions-strides"},{"id":"ref-for-dom-mlpool2doptions-strides\u2460"},{"id":"ref-for-dom-mlpool2doptions-strides\u2461"},{"id":"ref-for-dom-mlpool2doptions-strides\u2462"},{"id":"ref-for-dom-mlpool2doptions-strides\u2463"},{"id":"ref-for-dom-mlpool2doptions-strides\u2464"},{"id":"ref-for-dom-mlpool2doptions-strides\u2465"}],"title":"7.9.32. Pooling operations"}],"url":"#dom-mlpool2doptions-strides"},
13610-
"dom-mlpool2doptions-windowdimensions": {"dfnID":"dom-mlpool2doptions-windowdimensions","dfnText":"windowDimensions","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpool2doptions-windowdimensions"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2460"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2461"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2462"}],"title":"7.9.32. Pooling operations"}],"url":"#dom-mlpool2doptions-windowdimensions"},
13613+
"dom-mlpool2doptions-windowdimensions": {"dfnID":"dom-mlpool2doptions-windowdimensions","dfnText":"windowDimensions","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpool2doptions-windowdimensions"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2460"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2461"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2462"},{"id":"ref-for-dom-mlpool2doptions-windowdimensions\u2463"}],"title":"7.9.32. Pooling operations"}],"url":"#dom-mlpool2doptions-windowdimensions"},
1361113614
"dom-mlpowerpreference-default": {"dfnID":"dom-mlpowerpreference-default","dfnText":"default","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpowerpreference-default"}],"title":"7.2. ML interface"},{"refs":[{"id":"ref-for-dom-mlpowerpreference-default\u2460"},{"id":"ref-for-dom-mlpowerpreference-default\u2461"}],"title":"7.2.2. createContext()"}],"url":"#dom-mlpowerpreference-default"},
1361213615
"dom-mlpowerpreference-high-performance": {"dfnID":"dom-mlpowerpreference-high-performance","dfnText":"high-performance","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpowerpreference-high-performance"}],"title":"7.2. ML interface"}],"url":"#dom-mlpowerpreference-high-performance"},
1361313616
"dom-mlpowerpreference-low-power": {"dfnID":"dom-mlpowerpreference-low-power","dfnText":"low-power","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-mlpowerpreference-low-power"}],"title":"7.2. ML interface"}],"url":"#dom-mlpowerpreference-low-power"},

0 commit comments

Comments
 (0)