Skip to content

Commit

Permalink
Match createContext() options to the specification
Browse files Browse the repository at this point in the history
  • Loading branch information
reillyeon committed Feb 15, 2024
1 parent 3ab2d1f commit 2c864f9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions webnn-add.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<p>
Device preference:
<select id="device">
<option selected value="auto">Auto</option>
<option value="cpu">CPU</option>
<option selected value="cpu">CPU</option>
<option value="gpu">GPU</option>
</select>
</p>
Expand All @@ -24,10 +23,6 @@
<option value="high-performance">High performance</option>
</select>
</p>
<p>
Number of threads:
<input id="threads" type="number" value="0">
</p>
<p>
<button id="build">Build</button> <button disabled id="compute">Compute</button>
</p>
Expand All @@ -53,9 +48,8 @@
computeButton.disabled = true;

const options = {
devicePreference: deviceOption.value,
deviceType: deviceOption.value,
powerPreference: powerOption.value,
numThreads: threadsOption.value,
};
console.log(options);
context = await navigator.ml.createContext(options);
Expand Down

0 comments on commit 2c864f9

Please sign in to comment.