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
Fixed topk op #805
Fixed topk op #805
Conversation
k = k[0] | ||
if k is not None: | ||
is_k_attr = True | ||
layer_attrs["k"] = k |
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.
这里判断了k is not None,如果k是None会怎样?
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.
这里主要分为两种情况:k不为None,作为属性传入;k为None,作为输入传入
修改了下写法,判断k is not None以及else,Done.
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.
这种代码,加上注释吧。 之前的注释确实太少,现在有这种逻辑的,都加上注释说明,避免以后再回过头看代码,不清楚这个逻辑是在干啥
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.
Done.
k = k[0] | ||
if k is not None: | ||
is_k_attr = True | ||
layer_attrs["k"] = k |
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.
这种代码,加上注释吧。 之前的注释确实太少,现在有这种逻辑的,都加上注释说明,避免以后再回过头看代码,不清楚这个逻辑是在干啥
Create A Good Pull Request
Please check the follow step before merging this pull request
If this PR add new model support, please update
model_zoo.md
and add model to out test model zoos(@wjj19950828)Do follow contributes
1、优化topk实现,增加k为attr的实现
2、solved #803