Skip to content

Commit

Permalink
patrto: lenet - change createContext to use GPUDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
patrto committed Aug 28, 2024
1 parent 100ae69 commit 74d1f10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lenet/lenet.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export class LeNet {
throw new Error('Incorrect weights file');
}

this.context_ = await navigator.ml.createContext(contextOptions);
let adapter = await navigator.gpu.requestAdapter();
let device = await adapter.requestDevice();

this.context_ = await navigator.ml.createContext(device);
this.builder_ = new MLGraphBuilder(this.context_);
const inputShape = /* nchw */ [1, 1, 28, 28];
let input = this.builder_.input('input', {
Expand Down

0 comments on commit 74d1f10

Please sign in to comment.