Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues introduced by PR-228 #230

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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