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 vectorized div methods in favor of compact broadcast syntax #18607

Closed
wants to merge 1 commit into from

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Sep 20, 2016

This PR deprecates (almost) all remaining vectorized div methods (less a couple related to dates, separate PR) in favor of compact broadcast syntax. Ref. #16285, #17302, #18495, #18512, #18513, #18558, #18564, #18566, #18571 #18575, #18576, #18586, #18590, and #18593. Best!

(Unlike with float, real, etc., the remaining vectorized div methods never alias their input. This PR should be less controversial than #18495, #18512, and #18513 as a result.)

@stevengj
Copy link
Member

stevengj commented Dec 1, 2016

Ping ... you have a bunch of PRs like this. What is their status? Are they waiting on the sparse-broadcast stuff to stabilize?

@Sacha0
Copy link
Member Author

Sacha0 commented Dec 1, 2016

Echo :).

Yes, I thought these pull requests were blocked on (at least) completion of the sparse broadcast redesign/rewrite. If I mistook earlier discussion and you feel these pull requests should move forward immediately, please let me know. Otherwise, what mark do you feel sparse/structured broadcast functionality should hit for these pull requests to move forward?

Status of the sparse broadcast redesign/rewrite: I plan to rebase and merge #19371 following this post, and likewise #19438 tomorrow. #19438 was a warmup for giving broadcast a similar treatment, which I've started on and completion of which is my next objective. Please let me know if you think some other course of action would be better.

Also if you have a timescale in mind due to other pull requests being blocked on this work, please let me know.

Thanks for the ping and best!

@stevengj
Copy link
Member

stevengj commented Dec 1, 2016

That sounds reasonable.

@stevengj
Copy link
Member

stevengj commented Dec 1, 2016

I think there is supposed to be a feature freeze at the end of the year, though, so it would good to have the sparse-broadcast stuff and hence the vectorized dot operators by then.

@Sacha0
Copy link
Member Author

Sacha0 commented Dec 1, 2016

it would good to have the sparse-broadcast stuff and hence the vectorized dot operators by then

Agreed, hence my timescale question. That is, I want to make certain I leave you with enough time to e.g. comfortably wrap up #17623 before feature freeze. If that means I should finish the sparse broadcast rewrite in the next week or some such, let me know and I will prioritize it. Best!

F[i] = div(B[i], x)
end
return F
end
Copy link
Member Author

Choose a reason for hiding this comment

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

Did #17623 nix a former version of this method? If so, I will remove this method.

Copy link
Member

Choose a reason for hiding this comment

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

Yup, all the broadcast(::typeof(foo), ...) methods for BitArray were nixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cheers, removing this new method and will likewise remove the definition for mod that remains (just below) in the relevant PR. (I suppose this change also moves div's promotion behavior in the direction of #19669.) Thanks!

@Sacha0
Copy link
Member Author

Sacha0 commented Dec 23, 2016

Rebased. Best!

r1 = func(args...)
r2 = func(map(x->(isa(x, BitArray) ? Array(x) : x), args)...)
check_bitop_tests(ret_type, r1, r2)
end
function check_bitop_dotcall(ret_type, func, args...)
Copy link
Contributor

Choose a reason for hiding this comment

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

did the uses of this all get deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, good point! Removing that. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed. Thanks!

@@ -66,7 +66,7 @@ promote_array_type{S<:Integer}(::typeof(/), ::Type{S}, ::Type{Bool}, T::Type) =
promote_array_type{S<:Integer}(::typeof(\), ::Type{S}, ::Type{Bool}, T::Type) = T
promote_array_type{S<:Integer}(F, ::Type{S}, ::Type{Bool}, T::Type) = T

for f in (:+, :-, :div, :mod, :&, :|, :xor)
for f in (:+, :-, :mod, :&, :|, :xor)
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 change moves div's promotion behavior in the direction of #19669.)

@@ -89,7 +89,7 @@ function _elementwise{T}(op, ::Type{T}, A::AbstractArray, B::AbstractArray)
return F
end

for f in (:div, :mod, :rem, :&, :|, :xor, :/, :\, :*, :+, :-)
for f in (:mod, :rem, :&, :|, :xor, :/, :\, :*, :+, :-)
Copy link
Member Author

Choose a reason for hiding this comment

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

(Likewise here, this change moves div's promotion behavior in the direction of #19669.)

@Sacha0 Sacha0 force-pushed the devecdiv branch 2 times, most recently from 9ee217c to 340574a Compare December 23, 2016 23:44
@Sacha0 Sacha0 added this to the 0.6.0 milestone Dec 23, 2016
@Sacha0
Copy link
Member Author

Sacha0 commented Dec 31, 2016

Subsumed by #19791.

@Sacha0 Sacha0 closed this Dec 31, 2016
@Sacha0 Sacha0 deleted the devecdiv branch December 31, 2016 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:broadcast Applying a function over a collection domain:maths Mathematical functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants