Skip to content

Commit bfda418

Browse files
committed
Abort after rejecting promise in parallel steps
1 parent dcde7c9 commit bfda418

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.bs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1542,20 +1542,20 @@ Build a composed graph up to a given output operand into a computational graph a
15421542
<div class=algorithm-steps>
15431543
1. Let |promise| be [=a new promise=].
15441544
1. Return |promise| and run the following steps [=in parallel=]:
1545-
1. If |outputs| is empty, then [=reject=] |promise| with a {{TypeError}}.
1545+
1. If |outputs| is empty, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
15461546
1. [=map/For each=] |name| &rarr; |operand| of |outputs|:
1547-
1. If |name| is empty, then [=reject=] |promise| with a {{TypeError}}.
1548-
1. If any of the following sub-steps fail, then [=reject=] |promise| with an "{{OperationError}}" {{DOMException}}.
1547+
1. If |name| is empty, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
1548+
1. If any of the following sub-steps fail, then [=reject=] |promise| with an "{{OperationError}}" {{DOMException}}, and abort these steps.
15491549
1. Let |graph| be a new {{MLGraph}}:
15501550
1. Set |graph|.{{MLGraph/[[context]]}} to [=this=].{{MLGraphBuilder/[[context]]}}.
15511551
1. Make a request to the underlying platform to:
15521552
1. Connect |graph| to a new [=implementation-defined=] graph implementation |graphImpl| given |graph|.
15531553
1. Set |graph|.{{MLGraph/[[implementation]]}} to |graphImpl|.
15541554
1. Make a request to the underlying platform to initialize the graph:
15551555
1. [=map/For each=] |name| &rarr; |operand| of |outputs|:
1556-
1. If [=validating MLOperand=] given |operand| and [=this=] returns false, then [=reject=] |promise| with a {{TypeError}}.
1556+
1. If [=validating MLOperand=] given |operand| and [=this=] returns false, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
15571557
1. If |operand| was created as an input by the underlying platform:
1558-
1. If |operand|.{{MLOperand/[[name]]}} is not unique for |graphImpl|, then [=reject=] |promise| with a {{TypeError}}.
1558+
1. If |operand|.{{MLOperand/[[name]]}} is not unique for |graphImpl|, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
15591559
1. Add |operand|.{{MLOperand/[[descriptor]]}} to |graph|.{{MLGraph/[[inputDescriptors]]}}[|operand|.{{MLOperand/[[name]]}}].
15601560
1. If |operand| was created as a constant by the underlying platform:
15611561
1. Implementations MAY preprocess and optimize the tensor data of |operand| for the underlying platform.

0 commit comments

Comments
 (0)