Skip to content

Commit

Permalink
Fixed bug in options.activation (#183)
Browse files Browse the repository at this point in the history
Avoid reusing options object across ops.
  • Loading branch information
Honry authored Sep 27, 2023
1 parent 83737be commit 9ac0836
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions image_classification/mobilenet_nhwc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ export class MobileNetV2Nhwc {

dwiseOptions.autoPad = autoPad;
dwiseOptions.filterLayout = 'ihwo';
const convOptions = {autoPad, filterLayout: 'ohwi'};

const conv1x1Relu6 = await this.buildConv_(
input, weightsNameArray[0], `${biasPrefix}_expand_Conv2D`, true, convOptions);
input, weightsNameArray[0], `${biasPrefix}_expand_Conv2D`, true, {autoPad, filterLayout: 'ohwi'});
const dwise3x3Relu6 = await this.buildConv_(
conv1x1Relu6, weightsNameArray[1], `${biasPrefix}_depthwise_depthwise`, true, dwiseOptions);
const conv1x1Linear = await this.buildConv_(
dwise3x3Relu6, weightsNameArray[2], `${biasPrefix}_project_Conv2D`, false, convOptions);
dwise3x3Relu6, weightsNameArray[2], `${biasPrefix}_project_Conv2D`, false, {autoPad, filterLayout: 'ohwi'});

if (shortcut) {
return this.builder_.add(input, conv1x1Linear);
Expand Down

0 comments on commit 9ac0836

Please sign in to comment.