From adfca56b164a2290627c81ced6385d0ffd142a81 Mon Sep 17 00:00:00 2001 From: Satya Jandhyala Date: Thu, 7 Mar 2024 16:40:12 -0800 Subject: [PATCH] Check if the axis is with in the range. --- js/web/lib/wasm/jsep/webgpu/ops/concat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/web/lib/wasm/jsep/webgpu/ops/concat.ts b/js/web/lib/wasm/jsep/webgpu/ops/concat.ts index 97ead2e6624a4..010ee589c44fa 100644 --- a/js/web/lib/wasm/jsep/webgpu/ops/concat.ts +++ b/js/web/lib/wasm/jsep/webgpu/ops/concat.ts @@ -140,7 +140,7 @@ const createConcatProgramInfo = export const concat = (context: ComputeContext, attributes: ConcatAttributes): void => { const inputs = context.inputs; const inputShape = inputs[0].dims; - const adjustedAxis = attributes.axis + (attributes.axis < 0 ? inputShape.length : 0); + const adjustedAxis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length); validateInputs(inputs, adjustedAxis); const outputShape = inputShape.slice(); outputShape[adjustedAxis] =