-
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.
Improve type stability tests, better use of
AutoZero
backends (#437)
- Loading branch information
Showing
13 changed files
with
205 additions
and
222 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 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,57 @@ | ||
using DifferentiationInterface | ||
using DifferentiationInterface: AutoZeroForward, AutoZeroReverse | ||
using DifferentiationInterfaceTest | ||
using ComponentArrays: ComponentArrays | ||
using JLArrays: JLArrays | ||
using StaticArrays: StaticArrays | ||
using Test | ||
|
||
LOGGING = get(ENV, "CI", "false") == "false" | ||
|
||
zero_backends = [AutoZeroForward(), AutoZeroReverse()] | ||
|
||
for backend in zero_backends | ||
@test check_available(backend) | ||
@test check_twoarg(backend) | ||
end | ||
|
||
## Type stability | ||
|
||
test_differentiation( | ||
zero_backends, | ||
zero.(default_scenarios()); | ||
correctness=true, | ||
type_stability=true, | ||
excluded=[:second_derivative], | ||
logging=LOGGING, | ||
) | ||
|
||
test_differentiation( | ||
[ | ||
SecondOrder(AutoZeroForward(), AutoZeroReverse()), | ||
SecondOrder(AutoZeroReverse(), AutoZeroForward()), | ||
], | ||
default_scenarios(); | ||
correctness=false, | ||
type_stability=true, | ||
first_order=false, | ||
logging=LOGGING, | ||
) | ||
|
||
## Weird arrays | ||
|
||
test_differentiation( | ||
[AutoZeroForward(), AutoZeroReverse()], | ||
zero.(vcat(component_scenarios(), static_scenarios())); | ||
correctness=true, | ||
logging=LOGGING, | ||
) | ||
|
||
if VERSION >= v"1.10" | ||
test_differentiation( | ||
[AutoZeroForward(), AutoZeroReverse()], | ||
zero.(gpu_scenarios()); | ||
correctness=true, | ||
logging=LOGGING, | ||
) | ||
end |
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
Oops, something went wrong.