From a90442579580eb76a716856a687da289bdba99cd Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 26 Feb 2024 23:38:01 -0800 Subject: [PATCH] Bug fix: Validate MLGraph's context in MLContext's compute() (#584) This matches the Chromium prototype implementation. Fixes #341 --- index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/index.bs b/index.bs index c1ca9b3e..4b12a3ec 100644 --- a/index.bs +++ b/index.bs @@ -1040,6 +1040,7 @@ partial interface MLContext {
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}}.