mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-12 00:59:23 +00:00
[js/webgpu] Create Split indices helpers by rank, not by shape (#19554)
### Description This is required to make shape uniforms really work. ### Motivation and Context The bug was unveiled in a model with multiple Split nodes. The later nodes would try to reuse a previous pipeline cache, while the old shapes were hardcoded as constants in cache.
This commit is contained in:
parent
7efb0dbe12
commit
1b48054e1b
1 changed files with 2 additions and 2 deletions
|
|
@ -68,7 +68,7 @@ const createSplitProgramInfo = (inputs: readonly TensorView[], attributes: Split
|
|||
const dataType = inputs[0].dataType;
|
||||
const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);
|
||||
const outputs = new Array<IndicesHelper>(attributes.numOutputs);
|
||||
const input = inputVariable('input', dataType, inputShape);
|
||||
const input = inputVariable('input', dataType, inputShape.length);
|
||||
const sizeInSplitAxis = new Array<number>(attributes.numOutputs);
|
||||
const outputsTensorInfo: TensorInfo[] = [];
|
||||
const outputShapes: number[][] = [];
|
||||
|
|
@ -80,7 +80,7 @@ const createSplitProgramInfo = (inputs: readonly TensorView[], attributes: Split
|
|||
const outputShape = inputShape.slice();
|
||||
outputShape[attributes.axis] = attributes.splitSizes[i];
|
||||
outputShapes.push(outputShape);
|
||||
outputs[i] = outputVariable(`output${i}`, dataType, outputShape);
|
||||
outputs[i] = outputVariable(`output${i}`, dataType, outputShape.length);
|
||||
outputsTensorInfo.push({dims: outputShapes[i], dataType: inputs[0].dataType});
|
||||
}
|
||||
programUniforms.push(
|
||||
|
|
|
|||
Loading…
Reference in a new issue