Skip to content

Commit 25ae39b

Browse files
committed
Change location of flatten call
1 parent 2ad9857 commit 25ae39b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/blockbroadcast.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ end
129129
@inline _bview(A::AbstractArray, I...) = view(A, I...)
130130

131131
@inline function Broadcast.materialize!(dest, bc::Broadcasted{BS}) where {NDims, BS<:AbstractBlockStyle{NDims}}
132-
bcf = Broadcast.flatten(bc)
133-
dest_reshaped = ndims(dest) == NDims ? dest : reshape(dest, size(bcf))
132+
dest_reshaped = ndims(dest) == NDims ? dest : reshape(dest, size(bc))
134133
bc2 = Broadcast.instantiate(
135-
Broadcast.Broadcasted{BS}(bcf.f, bcf.args,
136-
map(combine_blockaxes, axes(dest_reshaped), axes(bcf))))
134+
Broadcast.Broadcasted{BS}(bc.f, bc.args,
135+
map(combine_blockaxes, axes(dest_reshaped), axes(bc))))
137136
copyto!(dest_reshaped, bc2)
138137
return dest
139138
end
140139

141140
function _generic_blockbroadcast_copyto!(dest::AbstractArray,
142-
bc::Broadcasted{<:AbstractBlockStyle{NDims}, <:Any, <:Any, Args}) where {NDims, Args <: Tuple}
141+
bc1::Broadcasted{<:AbstractBlockStyle{NDims}}) where {NDims}
143142

144-
NArgs = fieldcount(Args)
143+
bc = Broadcast.flatten(bc1)
144+
NArgs = length(bc.args)
145145

146146
bs = axes(bc)
147147
if !blockisequal(axes(dest), bs)

0 commit comments

Comments
 (0)