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)
265265 return ProjectTo {Ref} (; type= typeof (x), x= sub)
266266 end
267267end
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))
269269(project:: ProjectTo{Ref} )(dx:: Ref ) = Tangent {project.type} (; x= project. x (dx[]))
270270# Since this works like a zero-array in broadcasting, it should also accept a number:
271271(project:: ProjectTo{Ref} )(dx:: Number ) = Tangent {project.type} (; x= project. x (dx))
Original file line number Diff line number Diff line change 7070 @test ComplexF64 (1.5 , z) === Complex {Float64} (1.5 , 0.0 )
7171
7272 @test convert (Bool, ZeroTangent ()) === false
73- @test convert (Int64, ZeroTangent ()) === 0
73+ @test convert (Int64, ZeroTangent ()) === Int64 ( 0 )
7474 @test convert (Float32, ZeroTangent ()) === 0.0f0
7575 @test convert (ComplexF64, ZeroTangent ()) === 0.0 + 0.0im
7676 end
You can’t perform that action at this time.
0 commit comments