@@ -224,7 +224,7 @@ julia> ArrayInterface.size(A)
224
224
(Static{3}(), Static{4}())
225
225
```
226
226
"""
227
- size (:: Any ) = nothing
227
+ size (A ) = Base . size (A)
228
228
"""
229
229
strides(A)
230
230
@@ -237,7 +237,7 @@ julia> ArrayInterface.strides(A)
237
237
(Static{1}(), 3)
238
238
```
239
239
"""
240
- strides (:: Any ) = nothing
240
+ strides (A ) = Base . strides (A)
241
241
"""
242
242
offsets(A)
243
243
@@ -246,7 +246,6 @@ it should return them as `Static` numbers.
246
246
For example, if `A isa Base.Matrix`, `offsets(A) === (Static(1), Static(1))`.
247
247
"""
248
248
offsets (:: Any ) = (Static {1} (),) # Assume arbitrary Julia data structures use 1-based indexing by default.
249
- @inline size (A:: AbstractArray{<:Any,N} ) where {N} = Base. size (A)
250
249
@inline strides (A:: Vector{<:Any} ) = (Static (1 ),)
251
250
@inline strides (A:: Array{<:Any,N} ) where {N} = (Static (1 ), Base. tail (Base. strides (A))... )
252
251
@inline strides (A:: AbstractArray{<:Any,N} ) where {N} = Base. strides (A)
274
273
@inline strides (B:: PermutedDimsArray{T,N,I1,I2,A} ) where {T,N,I1,I2,A<: AbstractArray{T,N} } = permute (strides (parent (B)), Val {I1} ())
275
274
@inline stride (A:: AbstractArray , :: Static{N} ) where {N} = strides (A)[N]
276
275
@inline stride (A:: AbstractArray , :: Val{N} ) where {N} = strides (A)[N]
276
+ stride (A, i) = Base. stride (A, i)
277
277
278
278
size (B:: S ) where {N,NP,T,A<: AbstractArray{T,NP} ,I,S <: SubArray{T,N,A,I} } = _size (size (parent (B)), B. indices, map (static_length, B. indices))
279
279
strides (B:: S ) where {N,NP,T,A<: AbstractArray{T,NP} ,I,S <: SubArray{T,N,A,I} } = _strides (strides (parent (B)), B. indices)
0 commit comments