Skip to content

Commit

Permalink
Merge pull request #781 from webmachinelearning/compute-deprecation-w…
Browse files Browse the repository at this point in the history
…arning

Add deprecation warning for compute() -> dispatch()
  • Loading branch information
huningxin authored Nov 8, 2024
2 parents 63e73b3 + 5b6e8eb commit 11f85ff
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 11f85ff

Please sign in to comment.