- 1. Let |operand| be the first argument.
- 1. Let |options| be the second argument.
- 1. If running the
steps with |options| returns `false`, then [=exception/throw=] a {{TypeError}} and abort these steps.
+ 1. [=Assert=]: the type of |operand| is {{MLOperand}}.
+ 1. If running the
steps with |options| returns `false`, then [=exception/throw=] a {{TypeError}} and abort these steps.
1. If any of the following sub-steps fail, throw an "{{OperationError}}" {{DOMException}} and stop.
1. Let |output| be the result of invoking the
steps given |operand|.
1. Make a request to the underlying platform to:
@@ -1949,8 +1936,7 @@ partial interface MLGraphBuilder {
The {{MLGraphBuilder/clamp(options)}} method steps are:
- 1. Let |options| be the first argument.
- 1. If running the
check clamp options steps with |options| returns `false`, then [=exception/throw=] a {{TypeError}} and abort these steps.
+ 1. If running the
check clamp options steps with |options| returns `false`, then [=exception/throw=] a {{TypeError}} and abort these steps.
1. Let |op| be the result of invoking the
create MLActivation steps with `"clamp"` and |options|.
1. If that throws an error, re-throw the error and abort these steps.
1. Return |op|.
@@ -1984,36 +1970,33 @@ partial interface MLGraphBuilder {
The permissions and context validity have been checked by [[#api-mlgraphbuilder-constructor]] steps.
- 1. Let |inputs| be the first argument.
- 1. [=Assert=]: the type of |inputs| is sequence of {{MLOperand}} objects.
- 1. [=Assert=]: the type of |axis| is `unsigned long`.
- 1. [=Assert=]: the shape, i.e. {{MLOperandDescriptor/dimensions}}) of each operand in |inputs| is the same, except on the dimension given by |axis| on which they are concatenated.
- 1. [=Assert=]: the {{MLOperandDescriptor/type}} of each operand in |inputs| is the same.
- 1. If any of the following steps fail, then throw a "{{DataError}}" {{DOMException}} and stop.
- 1. If |inputs| is not an array of [=objects=], fail.
- 1. If |axis| is not a positive integer [=number=], fail.
- 1. If |axis| is greater than or equal to the
rank of |inputs|, fail.
- 1. Let |desc| be |inputs|[0].{{MLOperand/[[descriptor]]}}.
- 1. Let |desc|.{{MLOperandDescriptor/dimensions}}[|axis|] be `0`.
- 1. For each |index| between 0 and the
rank of |inputs|:
- 1. If running
validate MLOperand given |inputs|[|index|] and [=this=] returns `false`, then fail.
- 1. For each |dim| between 0 and the
rank of |inputs|[|index|]:
-
- If the shape of each corresponding dimension and type of the operands, except for those of the dimension given by |axis|, is not the same, fail.
-
- 1. If |dim| is not equal to |axis| and if |inputs|[|index|].{{MLOperandDescriptor/dimensions}}[|dim|] is not equal to |inputs|[0].{{MLOperandDescriptor/dimensions}}[|dim|], fail.
- 1. If |inputs|[|dim|].{{MLOperandDescriptor/type}} is not equal to |inputs|[0].{{MLOperandDescriptor/type}}.
- 1. If |dim| is equal to |axis|, add to |desc|.{{MLOperandDescriptor/dimensions}}[|axis|] the value of |inputs|[|index|].{{MLOperandDescriptor/dimensions}}[|dim|].
- 1. If any of the following sub-steps fail, throw an "{{OperationError}}" {{DOMException}} and stop.
- 1. Let |output| be the result of invoking the
create MLOperand steps given [=this=] and |desc|.
- 1. Make a request to the underlying platform to:
- 1. Create an [=implementation-defined=] platform operator |concatImpl| for this method, given |inputs| and |axis|.
- 1. Store a reference of |concatImpl| in |output|.{{MLOperand/[[operator]]}}.
- 1. Create an [=implementation-defined=] platform operand |outputImpl| to represent output,given |output| and |concatImpl|.
- 1. Store a reference to |outputImpl| in |output|.{{MLOperand/[[operand]]}}.
- 1. Connect |inputs| as input to |concatImpl|.
- 1. Connect |output|.{{MLOperand/[[operand]]}} as output to |concatImpl|.
- 1. Return |output|.
+ 1. [=Assert=]: the type of |inputs| is sequence of {{MLOperand}} objects.
+ 1. [=Assert=]: the type of |axis| is `unsigned long`.
+ 1. [=Assert=]: the shape, i.e. {{MLOperandDescriptor/dimensions}}) of each operand in |inputs| is the same, except on the dimension given by |axis| on which they are concatenated.
+ 1. [=Assert=]: the {{MLOperandDescriptor/type}} of each operand in |inputs| is the same.
+ 1. If any of the following steps fail, then throw a "{{DataError}}" {{DOMException}} and stop.
+ 1. If |axis| is greater than or equal to the
rank of |inputs|, fail.
+ 1. Let |desc| be |inputs|[0].{{MLOperand/[[descriptor]]}}.
+ 1. Let |desc|.{{MLOperandDescriptor/dimensions}}[|axis|] be `0`.
+ 1. For each |index| between 0 and the
rank of |inputs|:
+ 1. If running
validate MLOperand given |inputs|[|index|] and [=this=] returns `false`, then fail.
+ 1. For each |dim| between 0 and the
rank of |inputs|[|index|]:
+
+ If the shape of each corresponding dimension and type of the operands, except for those of the dimension given by |axis|, is not the same, fail.
+
+ 1. If |dim| is not equal to |axis| and if |inputs|[|index|].{{MLOperandDescriptor/dimensions}}[|dim|] is not equal to |inputs|[0].{{MLOperandDescriptor/dimensions}}[|dim|], fail.
+ 1. If |inputs|[|dim|].{{MLOperandDescriptor/type}} is not equal to |inputs|[0].{{MLOperandDescriptor/type}}.
+ 1. If |dim| is equal to |axis|, add to |desc|.{{MLOperandDescriptor/dimensions}}[|axis|] the value of |inputs|[|index|].{{MLOperandDescriptor/dimensions}}[|dim|].
+ 1. If any of the following sub-steps fail, throw an "{{OperationError}}" {{DOMException}} and stop.
+ 1. Let |output| be the result of invoking the
create MLOperand steps given [=this=] and |desc|.
+ 1. Make a request to the underlying platform to:
+ 1. Create an [=implementation-defined=] platform operator |concatImpl| for this method, given |inputs| and |axis|.
+ 1. Store a reference of |concatImpl| in |output|.{{MLOperand/[[operator]]}}.
+ 1. Create an [=implementation-defined=] platform operand |outputImpl| to represent output,given |output| and |concatImpl|.
+ 1. Store a reference to |outputImpl| in |output|.{{MLOperand/[[operand]]}}.
+ 1. Connect |inputs| as input to |concatImpl|.
+ 1. Connect |output|.{{MLOperand/[[operand]]}} as output to |concatImpl|.
+ 1. Return |output|.