Skip to content

Commit

Permalink
Add deprecation warning for compute() -> dispatch()
Browse files Browse the repository at this point in the history
This will help direct readers who see the console.warn deprecation
messages to the right place. To be removed when the specification
patches land.
  • Loading branch information
anssiko committed Nov 7, 2024
1 parent 673c6b5 commit 5b6e8eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,9 @@ When the {{MLContext/[[contextType]]}} is set to [=context type/default=] with t
</details>

### {{MLContext/compute()}} ### {#api-mlcontext-compute}

ISSUE: {{MLContext/compute()}} will be deprecated and removed in favor of <code>[dispatch()](https://github.com/webmachinelearning/webnn/blob/main/mltensor-explainer.md#compute-vs-dispatch)</code>.

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}}.

<div class="note">
Expand Down

0 comments on commit 5b6e8eb

Please sign in to comment.