-
Notifications
You must be signed in to change notification settings - Fork 221
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
Type constructor in broadcast doesn't compile #1761
Comments
Simpler MWE:
I'm not sure we can fix this in generality. We already have a workaround for broadcasting just the type constructor, but I'm not sure how to rewrite that when it's part of the broadcast: Lines 17 to 19 in e9833ed
|
Perhaps we can fix this within adapt (by transforming function Adapt.adapt_structure(::Adaptor, bc::Broadcast.Broadcasted{Style}) where {Style}
Broadcasted{Style}(adapt(Adaptor(), Base.maybeconstructor(bc.f)), adapt(Adaptor(), bc.args), bc.axes)
end |
This is a more generic solution to the existing `broadcasted` definition that fixes JuliaGPU#1761 (as suggested in JuliaGPU#1761 (comment)).
This is a more generic solution to the existing `broadcasted` definition that fixes JuliaGPU#1761 (as suggested in JuliaGPU#1761 (comment)).
This is a more generic solution to the existing `broadcasted` definition that fixes #1761 (as suggested in #1761 (comment)).
I know this is closed, but is it maybe possible to extend the error message? Can hitting this issue be detected and a more specific and helpful message be produced? |
This specific problem shouldn't occur any more. |
Oh. Well, it seems to have, or something quite similar. Trying to construct a matrix of normal distributions with |
Hmm, may be related, made a new issue: #2514 |
Describe the bug
The
@.
broadcast syntax doesn't work if it involves likeFloat32(2)
in the expression.To reproduce
The Minimal Working Example (MWE) for this bug:
Manifest.toml
Expected behavior
This might be an intended behavior but this is confusing because the syntax works perfectly on CPU.
The actual code in my program is much more complicated and it wasn't the easiest task to nail down.
Version info
The text was updated successfully, but these errors were encountered: