Skip to content

Commit 9462c41

Browse files
committed
Revert previous change.
1 parent 675c863 commit 9462c41

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/broadcast.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ end
66
M = @inbounds size(p.a)[1]
77
(M, Base.tail(size(p.b))...)
88
end
9-
# @inline function Base.size(p::Product, i::Integer)
10-
# i == 1 && return @inbounds size(p.a)[1]
11-
# @inbounds size(p.b)[i]
12-
# end
13-
# @inline Base.length(p::Product) = prod(size(p))
14-
# @inline Base.broadcastable(p::Product) = p
9+
@inline function Base.size(p::Product, i::Integer)
10+
i == 1 && return @inbounds size(p.a)[1]
11+
@inbounds size(p.b)[i]
12+
end
13+
@inline Base.length(p::Product) = prod(size(p))
14+
@inline Base.broadcastable(p::Product) = p
1515
@inline numdims(A) = ndims(A) # fallback
16-
# @inline numdims(::Type{Product{A,B}}) where {A,B} = numdims(B)
17-
# @inline Base.ndims(::Type{Product{A,B}}) where {A,B} = numdims(B)
16+
@inline numdims(::Type{Product{A,B}}) where {A,B} = numdims(B)
17+
@inline Base.ndims(::Type{Product{A,B}}) where {A,B} = numdims(B)
1818
# This numdims nonsense is a hack to avoid type piracy in defining:
1919
@inline numdims(::Type{B}) where {N, S <: Base.Broadcast.AbstractArrayStyle{N}, B <: Base.Broadcast.Broadcasted{S}} = N
2020

0 commit comments

Comments
 (0)