Skip to content

Commit

Permalink
Delete StaticArrays Projection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Dec 27, 2023
1 parent 2c2d2bd commit a149e8a
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions test/projection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,27 +378,6 @@ struct NoSuperType end
@test pvec3(OffsetArray(rand(3,1), 0:2, 0:0)) isa Vector
end

#####
##### `StaticArrays`
#####

@testset "StaticArrays" begin
# There is no code for this, but when argument isa StaticArray, axes(x) === axes(dx)
# implies a check, and reshape will wrap a Vector into a static SizedVector:
pstat = ProjectTo(SA[1, 2, 3])
@test axes(pstat(rand(3))) === (SOneTo(3),)

# This recurses into structured arrays:
pst = ProjectTo(transpose(SA[1, 2, 3]))
@test axes(pst(rand(1,3))) === (SOneTo(1), SOneTo(3))
@test pst(rand(1,3)) isa Transpose

# When the argument is an ordinary Array, static gradients are allowed to pass,
# like FillArrays. Collecting to an Array would cost a copy.
pvec3 = ProjectTo([1, 2, 3])
@test pvec3(SA[1, 2, 3]) isa StaticArray
end

#####
##### `ChainRulesCore`
#####
Expand Down

0 comments on commit a149e8a

Please sign in to comment.