-
-
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
Broadcast inexact issues #16896
Comments
Dup of #4883 |
The key question is whether it's acceptable to use type-inference to pick the correct return type. Historically the answer has been "no," which means this is a hard problem. PRs that make it better are welcome. (Note the substantial rewrite of broadcast in #16260, however.) EDIT: I should also say, I know how much you've already been contributing, @TotalVerb! That comment was not intended in any way other than welcoming of all ideas. |
broadcast
seems to have a good chunk of inexact problems that its cousinmap
does not. This seems to be becausepromote_op
(and by extensionpromote_eltype_op
, whichbroadcast
uses) believes that functions return the same type that they receive by default. To me this behaviour is a little strange.The two-argument promote_op in int.jl tries executing function on one and one, and uses that type as the result type. I think this behaviour is better than assuming functions are all
T => T
functions. That this promote_op is smarter is evident when comparinglog
andlog10
:The text was updated successfully, but these errors were encountered: