Merged
Conversation
|
Thanks for your contribution! |
qili93
reviewed
Jul 27, 2021
| auto* out = ctx.Output<Tensor>("Out"); | ||
| auto dims = ctx.Attr<std::vector<int>>("dim"); | ||
| bool keep_dim = ctx.Attr<bool>("keep_dim"); | ||
|
|
Contributor
There was a problem hiding this comment.
需增加reduce_all, out_dtype 存在时的PADDEL_ENFORCE报错信息。或者增加NPU算子进行支持。
Contributor
Author
There was a problem hiding this comment.
done, thanks.
增加了对 attr reduce_all 的支持,增加了对attr in_dtype 和 out_dtype 必须为默认值的 PADDEL_ENFORCE 报错信息。
Contributor
There was a problem hiding this comment.
可以看下reduce_op.h里面对于in_dtype的说明,这个无法被用户设置,可以不用检查;然后out_dtype其实可以尝试加一个cast算子进行数据类型的转换
| self.outputs = { | ||
| 'Out': self.inputs['X'].max(axis=tuple(self.attrs['dim'])) | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
可以参考test_reduce_max_op_xpu.py增加reduce_all和out_dtype的单测,如果在C++部分支持reduce_all的输入的话。
Contributor
Author
There was a problem hiding this comment.
done, thanks.
增加了对 attr reduce_all 的单测。
1c3a041 to
f632ee8
Compare
f632ee8 to
74448ca
Compare
74448ca to
43c08c0
Compare
zhiqiu
approved these changes
Aug 2, 2021
lanxianghit
approved these changes
Aug 2, 2021
zhangting2020
approved these changes
Aug 2, 2021
Contributor
zhangting2020
left a comment
There was a problem hiding this comment.
LGTM for skip_check_grad_ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
OPs
Describe
add reduce_max