-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【Infer Symbolic Shape No.47】【BUAA】 Add frame op #67886
【Infer Symbolic Shape No.47】【BUAA】 Add frame op #67886
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
|
||
std::vector<symbol::DimExpr> output_shape; | ||
symbol::DimExpr n_frames; | ||
symbol::DimExpr frame_length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frame_length 应该需要从attribute里面取吧
end_axis = x_rank - 2; | ||
} | ||
|
||
PADDLE_ENFORCE_LE(static_cast<int>(frame_length.Get<std::int64_t>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个enforce缺少一个前置判断,判断x_shape中的DimExpr是不是全都是int类型
"Attribute(frame_length) of FrameOp should be less " | ||
"equal than sequence length, but got (%s) > (%s).", | ||
static_cast<int>(frame_length.Get<std::int64_t>()), | ||
static_cast<int>(seq_length.Get<std::int64_t>()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frame_length这里不需要cast了,是int类型的attribute
output_shape.push_back(x_shape[i]); | ||
} | ||
|
||
if (seq_length == -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是 !seq_length.isa<int64_t>(),再理解一下meta和符号推导是怎么表示动态维度的
} | ||
|
||
if (seq_length == -1) { | ||
n_frames = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里该使用新符号了
PR Category
CINN
PR Types
Improvements
Description
添加 frame 算子符号推导接口。