-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Default batch size to 1 * Add test * Remove ambiguity * Default Enzyme batch size to 8 * Actuallly 16 * Avoid ambiguity
- Loading branch information
Showing
8 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using ADTypes | ||
using DifferentiationInterface | ||
import DifferentiationInterface as DI | ||
using Test | ||
|
||
@testset "SecondOrder" begin | ||
backend = SecondOrder(AutoForwardDiff(), AutoZygote()) | ||
@test ADTypes.mode(backend) isa ADTypes.ForwardMode | ||
@test DifferentiationInterface.outer(backend) isa AutoForwardDiff | ||
@test DifferentiationInterface.inner(backend) isa AutoZygote | ||
end | ||
|
||
@testset "Sparse" begin | ||
for backend in [AutoForwardDiff(), AutoZygote()] | ||
sparse_backend = AutoSparse(backend) | ||
@test ADTypes.mode(sparse_backend) == ADTypes.mode(backend) | ||
@test check_available(sparse_backend) == check_available(backend) | ||
@test DI.twoarg_support(sparse_backend) == DI.twoarg_support(backend) | ||
@test DI.pushforward_performance(sparse_backend) == | ||
DI.pushforward_performance(backend) | ||
@test DI.pullback_performance(sparse_backend) == DI.pullback_performance(backend) | ||
end | ||
|
||
for backend in [ | ||
SecondOrder(AutoForwardDiff(), AutoZygote()), | ||
SecondOrder(AutoZygote(), AutoForwardDiff()), | ||
] | ||
sparse_backend = AutoSparse(backend) | ||
@test ADTypes.mode(sparse_backend) == ADTypes.mode(backend) | ||
@test DI.hvp_mode(sparse_backend) == DI.hvp_mode(backend) | ||
end | ||
end | ||
|
||
@testset "Batch size" begin | ||
@test DI.pick_batchsize(AutoZygote(), 2) == 1 | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters