diff --git a/lib/execution-plan.ts b/lib/execution-plan.ts index cf1bf0ff..a4baac72 100644 --- a/lib/execution-plan.ts +++ b/lib/execution-plan.ts @@ -121,6 +121,7 @@ export class ExecutionPlan { }); // resolve downstream nodes + const downstreamNodes = new Set(); outputList.forEach((output, i) => { const j = thisOp.node.outputs[i]; for (const currentDownstreamNodeIndex of graphValues[j].to) { @@ -133,10 +134,11 @@ export class ExecutionPlan { } } if (resolved) { - sequence.push(currentDownstreamNodeIndex); + downstreamNodes.add(currentDownstreamNodeIndex); } } }); + sequence.push(...downstreamNodes); } const output: Tensor[] = [];