Skip to content

Commit

Permalink
Bug fix: Validate MLGraph's context in MLContext's compute() (#584)
Browse files Browse the repository at this point in the history
This matches the Chromium prototype implementation.

Fixes #341
  • Loading branch information
inexorabletash authored Feb 27, 2024
1 parent abd434d commit a904425
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ partial interface MLContext {
<div class=algorithm-steps>
1. Let |promise| be [=a new promise=].
1. Return |promise| and run the following steps [=in parallel=]:
1. If |graph|.{{MLGraph/[[context]]}} is not [=this=], then [=reject=] |promise| with a "{{DataError}}" {{DOMException}}.
1. If |graph|.{{MLGraph/[[context]]}}.{{MLContext/[[contextType]]}} is not "[=context type/default=]", [=reject=] |promise| with an "{{OperationError}}" {{DOMException}}.
1. If [=validating graph resources=] given |inputs| and |graph|.{{MLGraph/[[inputDescriptors]]}} returns false, then [=reject=] |promise| with a "{{DataError}}" {{DOMException}}.
1. If [=validating graph resources=] given |outputs| and |graph|.{{MLGraph/[[outputDescriptors]]}} returns false, then [=reject=] |promise| with a "{{DataError}}" {{DOMException}}.
Expand Down

0 comments on commit a904425

Please sign in to comment.