@@ -6,7 +6,7 @@ import {buildConstantByNpy} from '../common/utils.js';
66export class MobileNetV2Nchw {
77 constructor ( ) {
88 this . context_ = null ;
9- this . devicePreference_ = null ;
9+ this . deviceType_ = null ;
1010 this . builder_ = null ;
1111 this . graph_ = null ;
1212 this . weightsUrl_ = '../test-data/models/mobilenetv2_nchw/weights/' ;
@@ -34,7 +34,7 @@ export class MobileNetV2Nchw {
3434 // TODO: Set clamp activation to options once it's supported in
3535 // WebNN DML backend.
3636 // Implement `clip` by `clamp` of WebNN API
37- if ( this . devicePreference_ == 'gpu' ) {
37+ if ( this . deviceType_ == 'gpu' ) {
3838 return this . builder_ . clamp (
3939 this . builder_ . conv2d ( input , weights , options ) ,
4040 { minValue : 0 , maxValue : 6 } ) ;
@@ -76,7 +76,7 @@ export class MobileNetV2Nchw {
7676
7777 async load ( contextOptions ) {
7878 this . context_ = await navigator . ml . createContext ( contextOptions ) ;
79- this . devicePreference_ = contextOptions . devicePreference ;
79+ this . deviceType_ = contextOptions . deviceType ;
8080 this . builder_ = new MLGraphBuilder ( this . context_ ) ;
8181 const data = this . builder_ . input ( 'input' ,
8282 { type : 'float32' , dimensions : this . inputOptions . inputDimensions } ) ;
0 commit comments