@@ -80,7 +80,7 @@ struct NoSuperType end
80
80
81
81
prow = ProjectTo ([1im 2 3im ])
82
82
@test prow (transpose ([1 , 2 , 3 + 4.0im ])) == [1 2 3 + 4im ]
83
- @test prow (transpose ([1 , 2 , 3 + 4.0im ])) isa Matrix # row vectors may not pass through
83
+ @test prow (transpose ([1 , 2 , 3 + 4.0im ])) isa Matrix # row vectors may not pass through
84
84
@test prow (adjoint ([1 , 2 , 3 + 5im ])) == [1 2 3 - 5im ]
85
85
@test prow (adjoint ([1 , 2 , 3 ])) isa Matrix
86
86
@@ -145,7 +145,7 @@ struct NoSuperType end
145
145
146
146
@test ProjectTo (Ref (true )) isa ProjectTo{NoTangent}
147
147
@test ProjectTo (Ref ([false ]' )) isa ProjectTo{NoTangent}
148
-
148
+
149
149
@test ProjectTo (Ref (1.0 ))(Ref (NoTangent ())) === NoTangent () # collapse all-zero
150
150
end
151
151
@@ -376,7 +376,7 @@ struct NoSuperType end
376
376
377
377
pvec3 = ProjectTo ([1 , 2 , 3 ])
378
378
@test axes (pvec3 (OffsetArray (rand (3 ), 0 : 2 ))) == (1 : 3 ,)
379
- @test pvec3 (OffsetArray (rand (3 ), 0 : 2 )) isa Vector # relies on axes === axes test
379
+ @test pvec3 (OffsetArray (rand (3 ), 0 : 2 )) isa Vector # relies on axes === axes test
380
380
@test pvec3 (OffsetArray (rand (3 ,1 ), 0 : 2 , 0 : 0 )) isa Vector
381
381
end
382
382
@@ -463,4 +463,12 @@ struct NoSuperType end
463
463
psymm = ProjectTo (Symmetric (rand (10 ^ 3 , 10 ^ 3 )))
464
464
@test_broken 0 == @ballocated $ psymm (dx) setup = (dx = Symmetric (rand (10 ^ 3 , 10 ^ 3 ))) # 64
465
465
end
466
+
467
+ @testset " #685" begin
468
+ @test ProjectTo (BitArray ([0 ]))([1.0 ]) == NoTangent ()
469
+ @test ProjectTo (BitArray ([0 ]))(@thunk [1.0 ]) == NoTangent ()
470
+
471
+ it = InplaceableThunk (x -> x + [1 ], @thunk [1.0 ])
472
+ @test ProjectTo (BitArray ([0 ]))(it) == NoTangent ()
473
+ end
466
474
end
0 commit comments