jonniedie / ComponentArrays.jl

Arrays with arbitrarily nested named components.
MIT License
286 stars 34 forks source link

`Diagonal(ComponentArray)` scalar indexing error #250

Open vpuri3 opened 4 months ago

vpuri3 commented 4 months ago
julia> 1f0 .* Diagonal(ComponentArray((;a = CUDA.ones(4))))
ERROR: Scalar indexing is disallowed.
jonniedie commented 3 months ago

Hm. Not sure how to fix this on my end because the broadcasted copyto! method for Diagonals does scalar indexing in a for loop. I don't want to special-case this for each matrix type. Might be worth figuring out how

1f0 .* Diagonal(CUDA.ones(4))

works. Maybe that's being special-cased by CUDA?