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 Nov 12, 2024
1 parent eddcc1c commit 01ee569
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 @@ -25,7 +25,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];
const inputDesc = {
Expand Down

0 comments on commit 01ee569

Please sign in to comment.