Skip to content

Commit

Permalink
Fixed issues introduced by PR-228 (#230)
Browse files Browse the repository at this point in the history
- buildConstantByNpy should have a default vaule for new parameter
- Fixed typo in ssd_mobilenetv1_nchw.js
  • Loading branch information
Honry authored May 6, 2024
1 parent a3ef74d commit 3ce8c0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const toHalf = (function() {

// Convert npy data in original data type to `targetType`, only support
// 'float32' to 'float16' conversion currently.
export async function buildConstantByNpy(builder, url, targetType) {
export async function buildConstantByNpy(builder, url, targetType = 'float32') {
const dataTypeMap = new Map([
['f2', {type: 'float16', array: Uint16Array}],
['f4', {type: 'float32', array: Float32Array}],
Expand Down
2 changes: 1 addition & 1 deletion object_detection/ssd_mobilenetv1_nchw.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ ${nameArray[1]}_BatchNorm_batchnorm`;

if (this.targetDataType_ === 'float16') {
boxes = this.builder_.cast(boxes, 'float32');
scores = this.builder_.cast(boxes, 'float32');
scores = this.builder_.cast(scores, 'float32');
}
return {boxes, scores};
}
Expand Down

0 comments on commit 3ce8c0d

Please sign in to comment.