Skip to content

Commit b81e927

Browse files
authored
Merge pull request #248 from Honry/unfuse-activation
Unfuse activation in facenet_nchw.js
2 parents 919aa9f + 897226c commit b81e927

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

face_recognition/facenet_nchw.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export class FaceNetNchw {
4141
bias: bias,
4242
};
4343
}
44-
if (relu) {
45-
options.activation = this.builder_.relu();
46-
}
44+
4745
// WebNN spec drops autoPad support, compute the explicit padding instead.
4846
if (options.autoPad == 'same-upper') {
4947
options.padding =
@@ -52,7 +50,8 @@ export class FaceNetNchw {
5250
/* oihw */[weights.shape()[2], weights.shape()[3]],
5351
options.strides, options.dilations, options.autoPad);
5452
}
55-
return this.builder_.conv2d(input, weights, options);
53+
const conv2d = this.builder_.conv2d(input, weights, options);
54+
return relu ? this.builder_.relu(conv2d) : conv2d;
5655
}
5756

5857
async buildBlock35_(input, indice, weightsSuffixes) {

0 commit comments

Comments
 (0)