Skip to content

Commit

Permalink
concat: fix 1 input
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Sep 13, 2022
1 parent 21b5dfe commit 67ea4cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/web/lib/onnxjs/backends/webgpu/ops/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ const readBufferDataImpl = (indicesHelper: readonly IndicesHelper[], tensorRank:
const codeLines: string[] = [];
for (let i = 0; i < numberOfTensors; ++i) {
const returnSnippet = `return input${i}[${indicesHelper[i].i2oExpression('indices', true)}];`;
if (i === 0) {
if (numberOfTensors === 1) {
codeLines.push(returnSnippet);
} else if (i === 0) {
codeLines.push(`if (textureIndex == ${i}u) { ${returnSnippet} }`);
} else if (i === numberOfTensors - 1) {
codeLines.push(`else { ${returnSnippet} }`);
Expand Down

0 comments on commit 67ea4cb

Please sign in to comment.