Skip to content
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

Deprecate cumsum, cumprod, cumsum_kbn, and accumulate when dim isn't specified #24684

Merged
merged 5 commits into from
Nov 24, 2017

Conversation

andreasnoack
Copy link
Member

...and dimension is larger than one

Fixes #19451

@ararslan ararslan added deprecation This change introduces or involves a deprecation maths Mathematical functions labels Nov 21, 2017
@kshyatt
Copy link
Contributor

kshyatt commented Nov 21, 2017

Rebase?

@@ -691,7 +691,7 @@ function _cumsum!(out, v, axis, ::TypeArithmetic)
end

"""
cumsum(A, dim=1)
cumsum(A, dim)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT there should be a separate docstring for AbstractVector, right? Also, ::Integer would be useful since there's no longer any indication of the expected type in the signature.

@andreasnoack andreasnoack force-pushed the anj/accumulate branch 2 times, most recently from e8d02ea to 5ff1bad Compare November 22, 2017 14:13
@@ -691,9 +691,9 @@ function _cumsum!(out, v, axis, ::TypeArithmetic)
end

"""
cumsum(A, dim)
cumsum(A, axis::Integer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep dim or use region, which are the two terms that appear to be common in similar functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the method uses. They used to be out of sync. However, since we have reducedim, it is probably better to use dim here as well. I'll update.


Cumulative operation `op` on `A` along the axis `axis`, storing the result in `B`.
Cumulative operation `op` on `A` along the dimensions `dim`, storing the result in `B`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singular "dimension".

Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the singular/plural issue with "dimensions" in several places.

@andreasnoack
Copy link
Member Author

singular/plural issue with "dimensions" in several places.

Should be fixed now.

Fix bug in accumulate when initial value is provided since the implementation
doesn't support multidimentional arrays.

Move the accumulate methods with initial values to the end
@andreasnoack andreasnoack merged commit 999a4ff into master Nov 24, 2017
@andreasnoack andreasnoack deleted the anj/accumulate branch November 24, 2017 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation This change introduces or involves a deprecation maths Mathematical functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants