Skip to content

Commit

Permalink
fix auot-dist with nop output
Browse files Browse the repository at this point in the history
  • Loading branch information
xhuohai committed Sep 26, 2024
1 parent 2e28739 commit c4e916b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modules/Nncase.Modules.CPU/Passes/Distributed/AutoDistributed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,19 @@ void Dfs(IEquality equality)
var outputs = typeEquivalents.Select(g => InstertTerminator(g.Value[0]))
.Select(e => new EqualityNode(e))
.OfType<IEquality>().ToList();
_equalMemo.Add(function.Body, new EqualityClass(false, outputs));

using (new ExprPinner(outputs.Select(e => ((EqualityNode)e).Expr).ToArray()))
if (outputs.Any())
{
BranchCut();
_equalMemo.Add(function.Body, new EqualityClass(false, outputs));

using (new ExprPinner(outputs.Select(e => ((EqualityNode)e).Expr).ToArray()))
{
BranchCut();
}
}
else
{
return input;
}
}

Expand Down

0 comments on commit c4e916b

Please sign in to comment.