File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ function ProjectTo(x::Ref)
265
265
return ProjectTo {Ref} (; type= typeof (x), x= sub)
266
266
end
267
267
end
268
- (project:: ProjectTo{Ref} )(dx:: Tangent ) = Tangent {project.type} (; x= project. x (dx. x))
268
+ (project:: ProjectTo{Ref} )(dx:: Tangent{<:Ref} ) = Tangent {project.type} (; x= project. x (dx. x))
269
269
(project:: ProjectTo{Ref} )(dx:: Ref ) = Tangent {project.type} (; x= project. x (dx[]))
270
270
# Since this works like a zero-array in broadcasting, it should also accept a number:
271
271
(project:: ProjectTo{Ref} )(dx:: Number ) = Tangent {project.type} (; x= project. x (dx))
Original file line number Diff line number Diff line change 70
70
@test ComplexF64 (1.5 , z) === Complex {Float64} (1.5 , 0.0 )
71
71
72
72
@test convert (Bool, ZeroTangent ()) === false
73
- @test convert (Int64, ZeroTangent ()) === 0
73
+ @test convert (Int64, ZeroTangent ()) === Int64 ( 0 )
74
74
@test convert (Float32, ZeroTangent ()) === 0.0f0
75
75
@test convert (ComplexF64, ZeroTangent ()) === 0.0 + 0.0im
76
76
end
You can’t perform that action at this time.
0 commit comments