|
38 | 38 | "html": "<p>Set <var>context</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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>" |
39 | 39 | }, |
40 | 40 | { |
41 | | - "html": "<p>If <var>options</var>[\"<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlcontext-devicetype-slot\" id=\"ref-for-dom-mlcontext-devicetype-slot②\">[[deviceType]]</a></code> to <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mldevicetype-cpu\" id=\"ref-for-dom-mldevicetype-cpu②\">\"cpu\"</a></code>.</p>" |
| 41 | + "html": "<p>If <var>options</var>[\"<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlcontextoptions-devicetype\" id=\"ref-for-dom-mlcontextoptions-devicetype②\">deviceType</a></code>\"].</p>" |
42 | 42 | }, |
43 | 43 | { |
44 | | - "html": "<p>If <var>options</var>[\"<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlcontext-powerpreference-slot\" id=\"ref-for-dom-mlcontext-powerpreference-slot②\">[[powerPreference]]</a></code> to <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpowerpreference-default\" id=\"ref-for-dom-mlpowerpreference-default②\">\"default\"</a></code>.</p>" |
| 44 | + "html": "<p>Otherwise, set <var>context</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlcontext-devicetype-slot\" id=\"ref-for-dom-mlcontext-devicetype-slot②\">[[deviceType]]</a></code> to <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mldevicetype-cpu\" id=\"ref-for-dom-mldevicetype-cpu②\">\"cpu\"</a></code>.</p>" |
| 45 | + }, |
| 46 | + { |
| 47 | + "html": "<p>If <var>options</var>[\"<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlcontextoptions-powerpreference\" id=\"ref-for-dom-mlcontextoptions-powerpreference②\">powerPreference</a></code>\"].</p>" |
| 48 | + }, |
| 49 | + { |
| 50 | + "html": "<p>Otherwise, set <var>context</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlcontext-powerpreference-slot\" id=\"ref-for-dom-mlcontext-powerpreference-slot②\">[[powerPreference]]</a></code> to <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpowerpreference-default\" id=\"ref-for-dom-mlpowerpreference-default②\">\"default\"</a></code>.</p>" |
45 | 51 | } |
46 | 52 | ] |
47 | 53 | }, |
|
4073 | 4079 | "html": "<p>If <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/webnn/#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>" |
4074 | 4080 | }, |
4075 | 4081 | { |
4076 | | - "html": "<p>If <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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>" |
| 4082 | + "html": "<p>If <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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>" |
4077 | 4083 | }, |
4078 | 4084 | { |
4079 | | - "html": "<p>Otherwise, set <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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>" |
| 4085 | + "html": "<p>If <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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>" |
4080 | 4086 | }, |
4081 | 4087 | { |
4082 | 4088 | "html": "<p>If <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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>" |
|
4118 | 4124 | "html": "<p>Let <var>desc</var> be a copy of <var>input</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mloperand-descriptor-slot\" id=\"ref-for-dom-mloperand-descriptor-slot⑨\">[[descriptor]]</a></code>.</p>" |
4119 | 4125 | }, |
4120 | 4126 | { |
4121 | | - "html": "<p>Let <var>outputShape</var> be the result of <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-layout\" id=\"ref-for-dom-mlpool2doptions-layout①\">layout</a></code>, <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape⑦⑨\">shape</a>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-roundingtype\" id=\"ref-for-dom-mlpool2doptions-roundingtype②\">roundingType</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-windowdimensions\" id=\"ref-for-dom-mlpool2doptions-windowdimensions③\">windowDimensions</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-padding\" id=\"ref-for-dom-mlpool2doptions-padding④\">padding</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-strides\" id=\"ref-for-dom-mlpool2doptions-strides⑥\">strides</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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>" |
| 4127 | + "html": "<p>Let <var>outputShape</var> be the result of <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-layout\" id=\"ref-for-dom-mlpool2doptions-layout①\">layout</a></code>, <var>input</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/webnn/#mloperand-shape\" id=\"ref-for-mloperand-shape⑦⑨\">shape</a>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-roundingtype\" id=\"ref-for-dom-mlpool2doptions-roundingtype②\">roundingType</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-windowdimensions\" id=\"ref-for-dom-mlpool2doptions-windowdimensions④\">windowDimensions</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-padding\" id=\"ref-for-dom-mlpool2doptions-padding④\">padding</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#dom-mlpool2doptions-strides\" id=\"ref-for-dom-mlpool2doptions-strides⑥\">strides</a></code>, <var>options</var>.<code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/webnn/#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=\"https://www.w3.org/TR/webnn/#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>" |
4122 | 4128 | }, |
4123 | 4129 | { |
4124 | 4130 | "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://www.w3.org/TR/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>" |
|
0 commit comments