Skip to content

Commit

Permalink
comment Zygote.forwarddiff tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prbzrg committed Aug 1, 2023
1 parent c3e1e29 commit 834350c
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/call_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,26 @@
# @test !isnothing(AbstractDifferentiation.hessian(adb, diff_loss, ps))
end

diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
@test !isnothing(Zygote.gradient(diff_loss, ps))
@test !isnothing(Zygote.jacobian(diff_loss, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss, ps))
diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
@test !isnothing(Zygote.gradient(diff_loss2, ps))
@test !isnothing(Zygote.jacobian(diff_loss2, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss2, ps))
@test !isnothing(Zygote.gradient(diff_loss3, ps))
@test !isnothing(Zygote.jacobian(diff_loss3, ps))
# diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
# @test !isnothing(Zygote.gradient(diff_loss3, ps))
# @test !isnothing(Zygote.jacobian(diff_loss3, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss3, ps))
@test !isnothing(Zygote.gradient(diff_loss4, ps))
@test !isnothing(Zygote.jacobian(diff_loss4, ps))
# diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
# @test !isnothing(Zygote.gradient(diff_loss4, ps))
# @test !isnothing(Zygote.jacobian(diff_loss4, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss4, ps))
Expand Down Expand Up @@ -223,26 +223,26 @@
# @test !isnothing(AbstractDifferentiation.hessian(adb, diff_loss, ps))
end

diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
@test !isnothing(Zygote.gradient(diff_loss, ps))
@test !isnothing(Zygote.jacobian(diff_loss, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss, ps))
diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
@test !isnothing(Zygote.gradient(diff_loss2, ps))
@test !isnothing(Zygote.jacobian(diff_loss2, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss2, ps))
@test !isnothing(Zygote.gradient(diff_loss3, ps))
@test !isnothing(Zygote.jacobian(diff_loss3, ps))
# diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
# @test !isnothing(Zygote.gradient(diff_loss3, ps))
# @test !isnothing(Zygote.jacobian(diff_loss3, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss3, ps))
@test !isnothing(Zygote.gradient(diff_loss4, ps))
@test !isnothing(Zygote.jacobian(diff_loss4, ps))
# diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
# @test !isnothing(Zygote.gradient(diff_loss4, ps))
# @test !isnothing(Zygote.jacobian(diff_loss4, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss4, ps))
Expand Down Expand Up @@ -365,26 +365,26 @@
# @test !isnothing(AbstractDifferentiation.hessian(adb, diff_loss, ps))
end

diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
@test !isnothing(Zygote.gradient(diff_loss, ps))
@test !isnothing(Zygote.jacobian(diff_loss, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss, ps))
diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
@test !isnothing(Zygote.gradient(diff_loss2, ps))
@test !isnothing(Zygote.jacobian(diff_loss2, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss2, ps))
@test !isnothing(Zygote.gradient(diff_loss3, ps))
@test !isnothing(Zygote.jacobian(diff_loss3, ps))
# diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
# @test !isnothing(Zygote.gradient(diff_loss3, ps))
# @test !isnothing(Zygote.jacobian(diff_loss3, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss3, ps))
@test !isnothing(Zygote.gradient(diff_loss4, ps))
@test !isnothing(Zygote.jacobian(diff_loss4, ps))
# diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
# @test !isnothing(Zygote.gradient(diff_loss4, ps))
# @test !isnothing(Zygote.jacobian(diff_loss4, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss4, ps))
Expand Down Expand Up @@ -505,26 +505,26 @@
# @test !isnothing(AbstractDifferentiation.hessian(adb, diff_loss, ps))
end

diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
@test !isnothing(Zygote.gradient(diff_loss, ps))
@test !isnothing(Zygote.jacobian(diff_loss, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian(diff_loss, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss, ps))
diff_loss2(x) = Zygote.checkpointed(diff_loss, x)
@test !isnothing(Zygote.gradient(diff_loss2, ps))
@test !isnothing(Zygote.jacobian(diff_loss2, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian(diff_loss2, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss2, ps))
@test !isnothing(Zygote.gradient(diff_loss3, ps))
@test !isnothing(Zygote.jacobian(diff_loss3, ps))
# diff_loss3(x) = Zygote.forwarddiff(diff_loss, x)
# @test !isnothing(Zygote.gradient(diff_loss3, ps))
# @test !isnothing(Zygote.jacobian(diff_loss3, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian(diff_loss3, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss3, ps))
@test !isnothing(Zygote.gradient(diff_loss4, ps))
@test !isnothing(Zygote.jacobian(diff_loss4, ps))
# diff_loss4(x) = Zygote.forwarddiff(diff_loss2, x)
# @test !isnothing(Zygote.gradient(diff_loss4, ps))
# @test !isnothing(Zygote.jacobian(diff_loss4, ps))
# @test !isnothing(Zygote.diaghessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian(diff_loss4, ps))
# @test !isnothing(Zygote.hessian_reverse(diff_loss4, ps))
Expand Down

0 comments on commit 834350c

Please sign in to comment.