-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
New .-broadcast throws no method error for promote_eltype_op
#18176
Comments
Maybe of interest:
(what does the first expansion actually mean?) |
As an optimization, the Apparently this is happening with |
(@pabloferz, does #16986 fix the error for |
@stevengj Yes, that example and all of the OP ones should work fine over #16986 #=
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0-dev.311 (2016-08-19 09:33 UTC)
_/ |\__'_|_|_|\__'_| | pz/broadcast/8877bcb (fork: 3 commits, 3 days)
|__/ | x86_64-linux-gnu
=#
julia> f(a,b,c) = a + b + c
f (generic function with 1 method)
julia> f.(1.0:2, 3, 4)
2-element Array{Float64,1}:
8.0
9.0
julia> f.(1.0:2, 3.0, 4.0)
2-element Array{Float64,1}:
8.0
9.0
julia> broadcast(f, 1.0:2, 3, 4)
2-element Array{Float64,1}:
8.0
9.0 |
Of course, the parsing problem should be handled separately to get the fusing optimization. |
Okay, the problem with the fusing is that |
@JeffBezanson, I suppose when Or we could just drop this optimization, but I was really hoping expressions like |
Alternatively, one might consider parsing |
@pabloferz, would it be possible to construct a minimal fix for this particular |
Yeah, I believe so, I'll submit a PR. Should I also add the easy case of broadcasting over tuples of the same size (that is just one or two lines)? |
@pabloferz, no that would violate the 0.5 feature freeze. Just the fix for broadcasting over mixtures of arrays and scalars would be great. |
(@TotalVerb, changing this to a macro is tricky too. Putting aside the effort of rewriting all the fusion code, there is the issue that macro expansion happens before things like |
Maybe not exactly related to the bug reported here, but at least the error message is the same:
This is with latest |
I think this is fixed by #18200? |
Yes, that should fix this too. |
Good to know. Thanks! |
* Fix JuliaLang#18176 (broadcast over mixtures of arrays and numeric scalars) * Fix JuliaLang#17984 (broadcast behavior over empty arrays)
For some reason the last call with two floats throws an error:
note the, according the the manual equivalent, direct broadcast call errors for all arguments:
If this is indeed a bug, maybe backport it to 0.5.
The text was updated successfully, but these errors were encountered: