You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -750,11 +750,11 @@ The <dfn dfn-for=MLContextOptions dfn-type=dict-member>powerPreference</dfn> opt
750
750
To <dfn>create a context</dfn> given [=realm=] |realm| and |options| (a {{GPUDevice}} or {{MLContextOptions}}), run these steps:
751
751
</summary>
752
752
1. Let |context| be a new {{MLContext}} object with |realm|.
753
-
1. If |options| is a {{GPUDevice}} object,
753
+
1. If |options| is a {{GPUDevice}} object:
754
754
1. Set |context|.{{MLContext/[[contextType]]}} to "[=context type/webgpu=]".
755
755
1. Set |context|.{{MLContext/[[deviceType]]}} to {{MLDeviceType/"gpu"}}.
756
756
1. Set |context|.{{MLContext/[[powerPreference]]}} to {{MLPowerPreference/"default"}}.
757
-
1. Otherwise,
757
+
1. Otherwise:
758
758
1. Set |context|.{{MLContext/[[contextType]]}} to "[=context type/default=]".
759
759
1. If |options|["{{MLContextOptions/deviceType}}"][=map/exists=], then set |context|.{{MLContext/[[deviceType]]}} to |options|["{{MLContextOptions/deviceType}}"]. Otherwise, set |context|.{{MLContext/[[deviceType]]}} to {{MLDeviceType/"cpu"}}.
760
760
1. If |options|["{{MLContextOptions/powerPreference}}"][=map/exists=], then set |context|.{{MLContext/[[powerPreference]]}} to |options|["{{MLContextOptions/powerPreference}}"]. Otherwise, set |context|.{{MLContext/[[powerPreference]]}} to {{MLPowerPreference/"default"}}.
1. If |options|.{{MLGruCellOptions/activations}}[=map/exists=], and [=MLGraphBuilder/validating activation=] with [=this=] and any [=list/item=] in it returns false, then [=exception/throw=] a {{TypeError}}.
3235
3235
1. If |input|'s [=MLOperand/dataType=] is not {{MLOperandDataType/"float32"}} or {{MLOperandDataType/"float16"}}, then [=exception/throw=] a {{TypeError}}.
3236
3236
1. If |input|'s [=MLOperand/rank=] is not 2, then [=exception/throw=] a {{TypeError}}.
3237
-
1. Let |batchSize| be |input|'s [=MLOperand/shape=][0];
3238
-
1. Let |inputSize| be |input|'s [=MLOperand/shape=][1];
3237
+
1. Let |batchSize| be |input|'s [=MLOperand/shape=][0].
3238
+
1. Let |inputSize| be |input|'s [=MLOperand/shape=][1].
3239
3239
1. If the [=MLOperand/dataType=] of any of |weight|, |recurrentWeight|, or |hiddenState| is not equal to |input|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}.
3240
3240
1. If |weight|'s [=MLOperand/shape=] is not equal to « 3 * |hiddenSize|, |inputSize| », then [=exception/throw=] a {{TypeError}}.
3241
3241
1. If |recurrentWeight|'s [=MLOperand/shape=] is not equal to « 3 * |hiddenSize|, |hiddenSize| », then [=exception/throw=] a {{TypeError}}.
The <dfn method for=MLGraphBuilder>pad(|input|, |beginningPadding|, |endingPadding|, |options|)</dfn> method steps are:
4510
4510
</summary>
4511
4511
1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}.
4512
-
1. If |input|'s [=MLOperand/rank=] is 0, then [=exception/throw=] a {{TypeError}}
4512
+
1. If |input|'s [=MLOperand/rank=] is 0, then [=exception/throw=] a {{TypeError}}.
4513
4513
1. If |beginningPadding|'s [=list/size=] and |endingPadding|'s [=list/size=] are not both equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}.
4514
4514
1. Let |desc| be a copy of |input|.{{MLOperand/[[descriptor]]}}.
4515
4515
1. Let |outputShape| be the result of [=MLGraphBuilder/calculating padding output sizes=] given |input|, |beginningPadding| and |endingPadding|.
1. Let |outputSizes| be the result of [=MLGraphBuilder/calculating conv2d output sizes=] given |inputHeight|, |inputWidth|, |windowDimensions|[0], |windowDimensions|[1], |padding|, |strides|, and |dilations|.
The <dfn method for=MLGraphBuilder>reduceMean(|input|, |options|)</dfn> method steps are:
4968
-
1. Let |output| be the result of running the [=MLGraphBuilder/reduce-op | create reduce operation=] given "reduceMean", |input|, |options|, and « {{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}} »
4968
+
1. Let |output| be the result of running the [=MLGraphBuilder/reduce-op | create reduce operation=] given "reduceMean", |input|, |options|, and « {{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}} ».
4969
4969
1. If that [=exception/throws=] an error, then re-[=exception/throw=] the error.
0 commit comments