[js/web][bugfix] fix negative axes for unsqueeze (#11944)

[js/web] fix negative axes for unsqueeze
This commit is contained in:
Yosshi999 2022-06-29 03:28:35 +09:00 committed by GitHub
parent 9be2b6046b
commit 0702364d7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -791,7 +791,7 @@ export class ShapeUtil {
// set all axes indices to 1 in outputDims and check for duplicates
for (let i = 0; i < axes.length; i++) {
const axis = ShapeUtil.normalizeAxis(axes[i], dims.length);
const axis = ShapeUtil.normalizeAxis(axes[i], outputDims.length);
if (axis >= outputDims.length) {
throw new Error('\'axes\' has an out of range axis');
}