This repository was archived by the owner on Nov 17, 2023. It is now read-only.
[Backport][v1.6.x] Fix the wrong result of sum, mean, argmin, argmax when inputs contain inf or nan#16884
Merged
ptrendx merged 3 commits intoapache:v1.6.xfrom Nov 23, 2019
Merged
Conversation
…rgmin, argmax when inputs contain inf or nan
wkcn
commented
Nov 22, 2019
| const DType neginf) { | ||
| DType val = in_data[i]; | ||
| if (mshadow_op::IsNan<DType>(val)) val = nan; | ||
| if (val > 0 && mshadow_op::IsInf(val)) val = posinf; |
Member
Author
There was a problem hiding this comment.
Do I need to delete the modification in src/operator/tensor/elemwise_unary_op.h?
The class NumpyNanToNumParam was written in other PR, but I only modify several lines (701~703, 760~762) in it.
wkcn
commented
Nov 22, 2019
Member
Author
wkcn
left a comment
There was a problem hiding this comment.
Do I need to delete the modification in src/operator/tensor/elemwise_unary_op.h?
The class NumpyNanToNumParam was written in other PR, but I only modify several lines in it.
Member
|
@wkcn is that class part of 1.6? If not, then I agree you should delete those modifications - we do not want to introduce new functionality into 1.6 at this point, just fixes. |
Member
Author
|
Hi @ptrendx , I have deleted these modifications : ) |
larroy
reviewed
Jan 28, 2020
| * number is not a number */ | ||
| namespace isnan_typed { | ||
| template<typename DType> | ||
| MSHADOW_XINLINE bool IsNan(volatile DType val) { |
Contributor
There was a problem hiding this comment.
what's the point of volatile here?
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Hi, there.
In v1.6.x, there is a bug of reduce operators when the inputs contain inf and nan.
I cherry-pick 52716de into the branch v1.6.x.
Related PR: #16234