Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNNE-1891 Fix RangeOfMarker #1057

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Nncase.Passes/Rules/Neutral/AddRangeOfAndMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ public static bool CheckOp(Op op)
{
if (!pairs.ContainsKey(callParams[i]))
{
// 动态shape的情况下会先统计range再分段,matmul转conv2d则是需要知道shape才能做
// 动态shape情况下执行的顺序是range -> 分段 -> matmul转conv2d
// 这里必须要对matmul的rhs进行判断,如果matmul是动态的那么不会走量化,如果是静态的那么一定会转到conv2d
// 因此认为matmul的rhs为const的情况下一定能转成conv2d
bool isWeights = ((call.Target is Conv2D || call.Target is Conv2DTranspose) && (i == 1))
|| (call.Target is LSTM && i > 0);
|| (call.Target is LSTM && i > 0)
|| (call.Target is MatMul && i == 1 && callParams[1] is TensorConst);

if (!configExist && !useAutoMixQuant)
{
Expand Down