Skip to content

Commit 7fb3187

Browse files
committed
Abort after rejecting promise in parallel steps
1 parent d018fb2 commit 7fb3187

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
@@ -1393,20 +1393,20 @@ Build a composed graph up to a given output operand into a computational graph a
13931393
<div class=algorithm-steps>
13941394
1. Let |promise| be [=a new promise=].
13951395
1. Return |promise| and run the following steps [=in parallel=]:
1396-
1. If |outputs| is empty, then [=reject=] |promise| with a {{TypeError}}.
1396+
1. If |outputs| is empty, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
13971397
1. [=map/For each=] |name| &rarr; |operand| of |outputs|:
1398-
1. If |name| is empty, then [=reject=] |promise| with a {{TypeError}}.
1399-
1. If any of the following sub-steps fail, then [=reject=] |promise| with an "{{OperationError}}" {{DOMException}}.
1398+
1. If |name| is empty, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
1399+
1. If any of the following sub-steps fail, then [=reject=] |promise| with an "{{OperationError}}" {{DOMException}}, and abort these steps.
14001400
1. Let |graph| be a new {{MLGraph}}:
14011401
1. Set |graph|.{{MLGraph/[[context]]}} to [=this=].{{MLGraphBuilder/[[context]]}}.
14021402
1. Make a request to the underlying platform to:
14031403
1. Connect |graph| to a new [=implementation-defined=] graph implementation |graphImpl| given |graph|.
14041404
1. Set |graph|.{{MLGraph/[[implementation]]}} to |graphImpl|.
14051405
1. Make a request to the underlying platform to initialize the graph:
14061406
1. [=map/For each=] |name| &rarr; |operand| of |outputs|:
1407-
1. If [=validating MLOperand=] given |operand| and [=this=] returns false, then [=reject=] |promise| with a {{TypeError}}.
1407+
1. If [=validating MLOperand=] given |operand| and [=this=] returns false, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
14081408
1. If |operand| was created as an input by the underlying platform:
1409-
1. If |operand|.{{MLOperand/[[name]]}} is not unique for |graphImpl|, then [=reject=] |promise| with a {{TypeError}}.
1409+
1. If |operand|.{{MLOperand/[[name]]}} is not unique for |graphImpl|, then [=reject=] |promise| with a {{TypeError}}, and abort these steps.
14101410
1. Add |operand|.{{MLOperand/[[descriptor]]}} to |graph|.{{MLGraph/[[inputDescriptors]]}}[|operand|.{{MLOperand/[[name]]}}].
14111411
1. If |operand| was created as a constant by the underlying platform:
14121412
1. Implementations MAY preprocess and optimize the tensor data of |operand| for the underlying platform.

0 commit comments

Comments
 (0)