Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
FusionBolt committed Sep 13, 2023
1 parent 3b1fa95 commit 16f8583
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Nncase.Passes/Rules/ShapeBucket/ShapeBucketHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ public static bool ValidTarget(Call call, bool greedy)
return false;
}

private static bool IsDynamicReshape(Call call) => call.Target is Reshape && call.Arguments[Reshape.Shape.Index] is not Const;

public static bool IsSimple(BucketFusion fusion)
{
var v = new OpCollector();
Expand All @@ -110,6 +108,8 @@ public static bool IsSimple(BucketFusion fusion)

return true;
}

private static bool IsDynamicReshape(Call call) => call.Target is Reshape && call.Arguments[Reshape.Shape.Index] is not Const;
}

public static class ShapeBucketRegister
Expand Down
14 changes: 8 additions & 6 deletions src/Nncase.Passes/Rules/ShapeExpr/FoldSplitShapeOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ namespace Nncase.Passes.Rules.ShapeExpr;
[RuleGenerator]
public partial class FoldSplitShapeOf : RewriteRule<Pattern>
{

public override Pattern Pattern => IsStack(
null,
"stack",
IsTuple("tuple",
new VArgsPattern(list =>
Enumerable.Range(0, list.Length)
.Select(_ => IsGetItem(InputPattern, IsTensorConst()))
.ToArray(), "args")),
IsTuple(
"tuple",
new VArgsPattern(
list =>
Enumerable.Range(0, list.Length)
.Select(_ => IsGetItem(InputPattern, IsTensorConst()))
.ToArray(),
"args")),
IsTensorConst(tensor => tensor.Value.ToScalar<int>() == 0));

public Pattern InputPattern => IsShapeOf(IsWildcard());
Expand Down

0 comments on commit 16f8583

Please sign in to comment.