From 5b6e8eb1ef0c0a8f1b81c47704a01e37ca34c073 Mon Sep 17 00:00:00 2001 From: Anssi Kostiainen Date: Thu, 7 Nov 2024 10:47:31 +0200 Subject: [PATCH] Add deprecation warning for compute() -> dispatch() This will help direct readers who see the console.warn deprecation messages to the right place. To be removed when the specification patches land. --- index.bs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.bs b/index.bs index 6c50a70f..4890dce7 100644 --- a/index.bs +++ b/index.bs @@ -962,6 +962,9 @@ When the {{MLContext/[[contextType]]}} is set to [=context type/default=] with t ### {{MLContext/compute()}} ### {#api-mlcontext-compute} + +ISSUE: {{MLContext/compute()}} will be deprecated and removed in favor of [dispatch()](https://github.com/webmachinelearning/webnn/blob/main/mltensor-explainer.md#compute-vs-dispatch). + Asynchronously carries out the computational workload of a compiled graph {{MLGraph}} on a separate timeline, either on a worker thread for the CPU execution, or on a GPU/NPU timeline for submitting a workload onto the command queue. The asynchronous nature of this call avoids blocking the calling thread while the computation for result is ongoing. This method of execution requires an {{MLContext}} created with {{MLContextOptions}}. Otherwise, it [=exception/throws=] an "{{OperationError}}" {{DOMException}}.