File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 66 M = @inbounds size (p. a)[1 ]
77 (M, Base. tail (size (p. b))... )
88end
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
You can’t perform that action at this time.
0 commit comments