Skip to content

Fix inference on axes for broadcasting #547

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

Merged
merged 2 commits into from
Nov 19, 2018
Merged

Fix inference on axes for broadcasting #547

merged 2 commits into from
Nov 19, 2018

Conversation

timholy
Copy link
Member

@timholy timholy commented Nov 18, 2018

Fixes #546

@ChrisRackauckas
Copy link
Member

Does this fix #540 ?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 66.184% when pulling bb47a48 on teh/inferbcast into cf87ee2 on master.

@timholy
Copy link
Member Author

timholy commented Nov 18, 2018

Nope. Also doesn't fix #537 though it would seem that things here should at least make that easier. Finally, doesn't fix #485.

@timholy
Copy link
Member Author

timholy commented Nov 18, 2018

See also JuliaLang/julia#30074.

@@ -58,3 +58,6 @@ end
Base.@pure function Base.checkindex(::Type{Bool}, ::SOneTo{n1}, ::SOneTo{n2}) where {n1, n2}
return n1::Int >= n2::Int
end

Base.promote_rule(a::Type{Base.OneTo{T}}, ::Type{SOneTo{n}}) where {T,n} =
Base.OneTo{promote_type(T, Int)}
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, this is not strictly necessary for the fix (it's just the first thing I tried). I could get rid of this if you have reservations about it. (One also has to be rid of the tests this adds to core.jl.)

Copy link
Member

Choose a reason for hiding this comment

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

I think this is good.

@@ -58,3 +58,6 @@ end
Base.@pure function Base.checkindex(::Type{Bool}, ::SOneTo{n1}, ::SOneTo{n2}) where {n1, n2}
return n1::Int >= n2::Int
end

Base.promote_rule(a::Type{Base.OneTo{T}}, ::Type{SOneTo{n}}) where {T,n} =
Base.OneTo{promote_type(T, Int)}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is good.

@codecov-io
Copy link

Codecov Report

Merging #547 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
+ Coverage   66.12%   66.18%   +0.05%     
==========================================
  Files          38       38              
  Lines        2893     2898       +5     
==========================================
+ Hits         1913     1918       +5     
  Misses        980      980
Impacted Files Coverage Δ
src/SOneTo.jl 47.82% <ø> (ø) ⬆️
src/abstractarray.jl 89.36% <100%> (+0.47%) ⬆️
src/broadcast.jl 74.74% <100%> (+0.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf87ee2...bb47a48. Read the comment docs.

@timholy timholy merged commit 4f089af into master Nov 19, 2018
@timholy timholy deleted the teh/inferbcast branch November 19, 2018 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants