Skip to content

Commit

Permalink
Fix RecordFusionBucket
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnycase committed Jan 6, 2025
1 parent 28d58a6 commit 8ad4680
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Nncase.Diagnostics/Diagnostics/ILPrintVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ protected override string VisitFusion(Fusion expr)
var body_builder = new StringBuilder();
using (var body_writer = new StringWriter(body_builder))
{
var visitor = new ILPrintVisitor(body_writer, _displayCallable, _scope.IndentLevel).Visit(expr.Body);
var visitor = new ILPrintVisitor(body_writer, false, _scope.IndentLevel).Visit(expr.Body);
_scope.Append(body_writer.ToString());
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/Nncase.Passes/Rules/ShapeBucket/RecordFusionShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,16 @@ protected override ValueOrShape VisitLeafCall(Call expr)
break;
case Fusion fusion:
{
var eval = new PartialShapeEvaluator(fusion.Parameters.ToArray().Zip(args).ToDictionary(p => p.First, p => p.Second), DimDict);
var feedDict = new Dictionary<Var, ValueOrShape>(FeedDict.Concat(fusion.Parameters.ToArray().Zip(args).Select(x => new KeyValuePair<Var, ValueOrShape>(x.First, x.Second))));
var eval = new PartialShapeEvaluator(feedDict, DimDict);
result = eval.Visit(fusion.Body);
}

break;
case Function func:
{
var eval = new PartialShapeEvaluator(func.Parameters.ToArray().Zip(args).ToDictionary(p => p.First, p => p.Second), DimDict);
var feedDict = new Dictionary<Var, ValueOrShape>(FeedDict.Concat(func.Parameters.ToArray().Zip(args).Select(x => new KeyValuePair<Var, ValueOrShape>(x.First, x.Second))));
var eval = new PartialShapeEvaluator(feedDict, DimDict);
result = eval.Visit(func.Body);
}

Expand Down

0 comments on commit 8ad4680

Please sign in to comment.