icemelon9 commented on a change in pull request #5459:
URL: https://github.com/apache/incubator-tvm/pull/5459#discussion_r419648539
##########
File path: include/tvm/relay/attrs/algorithm.h
##########
@@ -50,14 +50,14 @@ struct ArgsortAttrs : public tvm::AttrsNode<ArgsortAttrs> {
};
struct TopKAttrs : public tvm::AttrsNode<TopKAttrs> {
- int k;
+ Expr k;
Review comment:
I think transformation pass needs to handle the cases when attrs is not
constant. `attrs` are designed to only hold constant values to make shape
inference easier. I think adding `Expr` to attrs is only a temporary work
around. Since we now have `Optional`, we should leverage it to represent the
cases that attrs are not constant.
cc @jroesch @tqchen @junrushao1994 What do you guys think about this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]