|
154 | 154 | "html": "<p>Set the data type of <var>inputTensor</var> to the one that matches <var>inputValue</var>’s <a data-link-type=\"dfn\" href=\"https://tc39.es/ecma262/#table-the-typedarray-constructors\" id=\"ref-for-table-the-typedarray-constructors①\">element type</a>.</p>" |
155 | 155 | }, |
156 | 156 | { |
157 | | - "html": "<p>Set the dimensions of <var>inputTensor</var> to <var>inputDescriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions\">dimensions</a></code>.</p>" |
| 157 | + "html": "<p>Set the shape of <var>inputTensor</var> to <var>inputDescriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape\">shape</a></code>.</p>" |
158 | 158 | }, |
159 | 159 | { |
160 | 160 | "html": "<p>Set the values of elements in <var>inputTensor</var> to the values of elements in <var>inputValue</var>.</p>" |
|
335 | 335 | "html": "<p>Set <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-datatype\" id=\"ref-for-dom-mloperanddescriptor-datatype②\">dataType</a></code> to <var>dataType</var>.</p>" |
336 | 336 | }, |
337 | 337 | { |
338 | | - "html": "<p>Set <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions②\">dimensions</a></code> to a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-clone\" id=\"ref-for-list-clone\">clone</a> of <var>dimensions</var>.</p>" |
| 338 | + "html": "<p>Set <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape②\">shape</a></code> to a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-clone\" id=\"ref-for-list-clone\">clone</a> of <var>shape</var>.</p>" |
339 | 339 | }, |
340 | 340 | { |
341 | 341 | "html": "<p>Return <var>descriptor</var>.</p>" |
|
351 | 351 | "html": "<p>Let <var>elementLength</var> be 1.</p>" |
352 | 352 | }, |
353 | 353 | { |
354 | | - "html": "<a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-iterate\" id=\"ref-for-list-iterate\">For each</a> <var>dimension</var> of <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions③\">dimensions</a></code>:", |
| 354 | + "html": "<a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-iterate\" id=\"ref-for-list-iterate\">For each</a> <var>dimension</var> of <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape③\">shape</a></code>:", |
355 | 355 | "rationale": "set", |
356 | 356 | "steps": [ |
357 | 357 | { |
|
373 | 373 | "rationale": ".algorithm", |
374 | 374 | "steps": [ |
375 | 375 | { |
376 | | - "html": "<p>If any element of <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions④\">dimensions</a></code> is not a <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#valid-dimension\" id=\"ref-for-valid-dimension\">valid dimension</a>, return false.</p>" |
| 376 | + "html": "<p>If any element of <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape④\">shape</a></code> is not a <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#valid-dimension\" id=\"ref-for-valid-dimension\">valid dimension</a>, return false.</p>" |
377 | 377 | }, |
378 | 378 | { |
379 | | - "html": "<p>If <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions⑤\">dimensions</a></code>'s <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-size\" id=\"ref-for-list-size\">size</a> is too large to be supported by the implementation, return false.</p>" |
| 379 | + "html": "<p>If <var>descriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape⑤\">shape</a></code>'s <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-size\" id=\"ref-for-list-size\">size</a> is too large to be supported by the implementation, return false.</p>" |
380 | 380 | }, |
381 | 381 | { |
382 | 382 | "html": "<p>If <var>descriptor</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperanddescriptor-byte-length\" id=\"ref-for-mloperanddescriptor-byte-length②\">byte length</a> is not supported by the implementation, then return false.</p>" |
|
982 | 982 | "html": "<p>Let <var>desc</var> be the result of <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#create-an-mloperanddescriptor\" id=\"ref-for-create-an-mloperanddescriptor②\">creating an MLOperandDescriptor</a> given <var>first</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-datatype\" id=\"ref-for-mloperand-datatype①⑤\">dataType</a> and <var>first</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape①②\">shape</a>.</p>" |
983 | 983 | }, |
984 | 984 | { |
985 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions⑦\">dimensions</a></code>[<var>axis</var>] to <var>first</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape①③\">shape</a>[<var>axis</var>].</p>" |
| 985 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape⑦\">shape</a></code>[<var>axis</var>] to <var>first</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape①③\">shape</a>[<var>axis</var>].</p>" |
986 | 986 | }, |
987 | 987 | { |
988 | 988 | "html": "<a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-iterate\" id=\"ref-for-list-iterate③\">For each</a> <var>index</var> in <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#the-range\" id=\"ref-for-the-range①\">the range</a> 1 to <var>inputs</var>’s <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-size\" id=\"ref-for-list-size⑦\">size</a>, exclusive:", |
|
1009 | 1009 | "rationale": "let", |
1010 | 1010 | "steps": [ |
1011 | 1011 | { |
1012 | | - "html": "<p>Let <var>size</var> be the sum of <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions⑧\">dimensions</a></code>[<var>axis</var>] and <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape①⑥\">shape</a>[<var>dim</var>].</p>" |
| 1012 | + "html": "<p>Let <var>size</var> be the sum of <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape⑧\">shape</a></code>[<var>axis</var>] and <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape①⑥\">shape</a>[<var>dim</var>].</p>" |
1013 | 1013 | }, |
1014 | 1014 | { |
1015 | 1015 | "html": "<p>If <var>size</var> is not a <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#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>" |
1016 | 1016 | }, |
1017 | 1017 | { |
1018 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions⑨\">dimensions</a></code>[<var>axis</var>] to <var>size</var>.</p>" |
| 1018 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape⑨\">shape</a></code>[<var>axis</var>] to <var>size</var>.</p>" |
1019 | 1019 | } |
1020 | 1020 | ] |
1021 | 1021 | } |
|
3671 | 3671 | "html": "<p>Let <var>desc</var> be a new <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dictdef-mloperanddescriptor\" id=\"ref-for-dictdef-mloperanddescriptor①⑧\">MLOperandDescriptor</a></code>.</p>" |
3672 | 3672 | }, |
3673 | 3673 | { |
3674 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions①⓪\">dimensions</a></code> to the <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list\" id=\"ref-for-list②④\">list</a> « <var>batchSize</var>, <var>hiddenSize</var> ».</p>" |
| 3674 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape①⓪\">shape</a></code> to the <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list\" id=\"ref-for-list②④\">list</a> « <var>batchSize</var>, <var>hiddenSize</var> ».</p>" |
3675 | 3675 | }, |
3676 | 3676 | { |
3677 | 3677 | "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-datatype\" id=\"ref-for-dom-mloperanddescriptor-datatype⑤\">dataType</a></code> to <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-datatype\" id=\"ref-for-mloperand-datatype①①⑦\">dataType</a>.</p>" |
|
3882 | 3882 | "html": "<p>Set <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mlpadoptions-value\" id=\"ref-for-dom-mlpadoptions-value①\">value</a></code> to the result of <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#cast\" id=\"ref-for-cast①⑤\">casting</a> <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mlpadoptions-value\" id=\"ref-for-dom-mlpadoptions-value②\">value</a></code> to <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://webmachinelearning.github.io/webnn/#mloperand-datatype\" id=\"ref-for-mloperand-datatype①②②\">dataType</a>.</p>" |
3883 | 3883 | }, |
3884 | 3884 | { |
3885 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions①①\">dimensions</a></code> to <var>outputShape</var>.</p>" |
| 3885 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape①①\">shape</a></code> to <var>outputShape</var>.</p>" |
3886 | 3886 | }, |
3887 | 3887 | { |
3888 | 3888 | "html": "<em>Make graph connections:</em>", |
|
4121 | 4121 | "html": "<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=\"https://webmachinelearning.github.io/webnn/#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>" |
4122 | 4122 | }, |
4123 | 4123 | { |
4124 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions①②\">dimensions</a></code> to <var>outputShape</var>.</p>" |
| 4124 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape①②\">shape</a></code> to <var>outputShape</var>.</p>" |
4125 | 4125 | }, |
4126 | 4126 | { |
4127 | 4127 | "html": "<em>Make graph connections:</em>", |
|
4642 | 4642 | "html": "<p>Let <var>inputDescriptor</var> be <var>input</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperand-descriptor-slot\" id=\"ref-for-dom-mloperand-descriptor-slot①⓪\">[[descriptor]]</a></code>.</p>" |
4643 | 4643 | }, |
4644 | 4644 | { |
4645 | | - "html": "<p>Let <var>outputShape</var> be a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-clone\" id=\"ref-for-list-clone①⑦\">clone</a> of <var>inputDescriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions①③\">dimensions</a></code>.</p>" |
| 4645 | + "html": "<p>Let <var>outputShape</var> be a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-clone\" id=\"ref-for-list-clone①⑦\">clone</a> of <var>inputDescriptor</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape①③\">shape</a></code>.</p>" |
4646 | 4646 | }, |
4647 | 4647 | { |
4648 | 4648 | "html": "<a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-iterate\" id=\"ref-for-list-iterate①②\">For each</a> <var>index</var> in <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#the-range\" id=\"ref-for-the-range①①\">the range</a> 0 to <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mlresample2doptions-axes\" id=\"ref-for-dom-mlresample2doptions-axes⑤\">axes</a></code>'s <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-size\" id=\"ref-for-list-size③⑥\">size</a>, exclusive:", |
|
4746 | 4746 | "html": "<p>Let <var>desc</var> be a copy of <var>input</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperand-descriptor-slot\" id=\"ref-for-dom-mloperand-descriptor-slot①①\">[[descriptor]]</a></code>.</p>" |
4747 | 4747 | }, |
4748 | 4748 | { |
4749 | | - "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-dimensions\" id=\"ref-for-dom-mloperanddescriptor-dimensions①④\">dimensions</a></code> to <var>newShape</var>.</p>" |
| 4749 | + "html": "<p>Set <var>desc</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://webmachinelearning.github.io/webnn/#dom-mloperanddescriptor-shape\" id=\"ref-for-dom-mloperanddescriptor-shape①④\">shape</a></code> to <var>newShape</var>.</p>" |
4750 | 4750 | }, |
4751 | 4751 | { |
4752 | 4752 | "html": "<em>Make graph connections:</em>", |
|
0 commit comments