Skip to content

Commit

Permalink
Merge branch 'master' into adaptext
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Jul 3, 2023
2 parents 6b0fa82 + e8964c8 commit ca00c79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CatIndices = "0.2"
DistributedArrays = "0.6"
Documenter = "0.27"
EllipsisNotation = "1"
FillArrays = "0.11, 0.13"
FillArrays = "0.11, 0.13, 1"
StaticArrays = "1"
julia = "0.7, 1"

Expand Down
2 changes: 1 addition & 1 deletion src/OffsetArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ _similar_axes_or_length(AT, ax::I, ::I) where {I} = similar(AT, map(_indexlength

# reshape accepts a single colon
Base.reshape(A::AbstractArray, inds::OffsetAxis...) = reshape(A, inds)
function Base.reshape(A::AbstractArray, inds::Tuple{OffsetAxis,Vararg{OffsetAxis}})
function Base.reshape(A::AbstractArray, inds::Tuple{Vararg{OffsetAxis}})
AR = reshape(no_offset_view(A), map(_indexlength, inds))
O = OffsetArray(AR, map(_offset, axes(AR), inds))
return _popreshape(O, axes(AR), _filterreshapeinds(inds))
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ CatIndices = "0.2"
DistributedArrays = "0.6"
Documenter = "0.27"
EllipsisNotation = "1"
FillArrays = "0.11, 0.13"
FillArrays = "0.11, 0.13, 1"
StaticArrays = "1"
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,10 @@ end
A = OffsetArray(rand(4, 4), -1, -1)
@test reshape(A, (:, )) == vec(A)
@test reshape(A, :) == vec(A)

# ensure that there's no ambiguity using AbstractArray and Tuple{Vararg{OffsetAxis}}
@test reshape(Fill(0), ()) === Fill(0)
@test reshape(Fill(2,6), big(2), :) == Fill(2, 2, 3)
end

@testset "permutedims" begin
Expand Down

0 comments on commit ca00c79

Please sign in to comment.