Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ArrayInterface"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "3.1.33"
version = "3.2.0"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
12 changes: 9 additions & 3 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ArrayInterface.axes_types
ArrayInterface.broadcast_axis
ArrayInterface.buffer
ArrayInterface.canonicalize
ArrayInterface.compose
ArrayInterface.deleteat
ArrayInterface.dense_dims
ArrayInterface.findstructralnz
Expand All @@ -58,18 +59,17 @@ ArrayInterface.offset1
ArrayInterface.offsets
ArrayInterface.parent_type
ArrayInterface.reduce_tup
ArrayInterface.relayout
ArrayInterface.relayout_constructor
ArrayInterface.restructure
ArrayInterface.safevec
ArrayInterface.setindex!
ArrayInterface.size
ArrayInterface.strides
ArrayInterface.to_axes
ArrayInterface.to_axis
ArrayInterface.to_dims
ArrayInterface.to_index
ArrayInterface.to_indices
ArrayInterface.to_parent_dims
ArrayInterface.unsafe_reconstruct
ArrayInterface.zeromatrix
```

Expand All @@ -78,9 +78,15 @@ ArrayInterface.zeromatrix
```@docs
ArrayInterface.ArrayIndex
ArrayInterface.BroadcastAxis
ArrayInterface.ComposedIndex
ArrayInterface.LazyAxis
ArrayInterface.LinearSubIndex
ArrayInterface.IdentityIndex
ArrayInterface.OptionallyStaticStepRange
ArrayInterface.OptionallyStaticUnitRange
ArrayInterface.PermutedIndex
ArrayInterface.SubIndex
ArrayInterface.StrideIndex
ArrayInterface.UnkownIndex
```

18 changes: 14 additions & 4 deletions src/ArrayInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ include("indexing.jl")
include("stridelayout.jl")
include("broadcast.jl")



function __init__()

@require SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" begin
Expand Down Expand Up @@ -758,9 +756,21 @@ function __init__()
@inline strides(B::StaticArrays.SizedArray{S,T,M,N,A}) where {S,T,M,N,A<:SubArray} = strides(B.data)
parent_type(::Type{<:StaticArrays.SizedArray{S,T,M,N,A}}) where {S,T,M,N,A} = A
else
parent_type(::Type{<:StaticArrays.SizedArray{S,T,M,N}}) where {S,T,M,N} =
Array{T,N}
parent_type(::Type{<:StaticArrays.SizedArray{S,T,M,N}}) where {S,T,M,N} = Array{T,N}
end

function static_size(x, inds)
StaticArrays.Size(ArrayInterface._mapsub(ArrayInterface.known_length, inds))
end

function ArrayInterface.relayout_constructor(::Type{<:StaticArrays.SArray})
static_size
end

function ArrayInterface.compose(x::NTuple{N}, y::StaticArrays.Size{S}) where {N,S}
StaticArrays.SArray{Tuple{S...},eltype(x),length(S),N}(x)
end

@require Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" begin
function Adapt.adapt_storage(
::Type{<:StaticArrays.SArray{S}},
Expand Down
Loading