fix: A new feature for NDArray.max #1091
Merged
Oceania2018 merged 3 commits intoSciSharp:masterfrom Jun 5, 2023
Merged
Conversation
Oceania2018
reviewed
Jun 2, 2023
| var x1 = new NDArray(new[,] { { 1, 2, 3 }, { 4, 5.1, 6 } }); | ||
| var x2 = new NDArray(new[,] { { 3, 2, 1 }, { 6, 5.1, 4 } }); | ||
| var y = np.maximum(x1,x2); | ||
| var y1 = np.maximum(x1, x2, axis: 0); |
Member
There was a problem hiding this comment.
Thanks for your contribution.
Can you add one more testing case
np.maximum(x1, x2, axis: 1)
Oceania2018
approved these changes
Jun 5, 2023
| var y3 = new NDArray(new[,] { { 3, 2, 3 }, { 6, 5.1, 6 } }); | ||
| var y4 = new NDArray(new[] { 6, 5.1, 6 }); | ||
| var y5 = new NDArray(new[] { 3.0, 6 }); | ||
| Assert.AreEqual(y0, y3); |
Member
There was a problem hiding this comment.
We can use the simplier syntax like: Assert.AreEqual(new[,] { { 3, 2, 3 }, { 6, 5.1, 6 } }, y0.numpy());
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.
Solve the problem that NDArray.max() does not support max from multiple dimensions and add a TestMethod. #635
And the NDArray.sum() method has already supported max from multiple dimensions.
Thanks!