Skip to content

Correct default atol to 0.0 #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/testers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
test_scalar(f, z; rtol=1e-9, atol=1e-9, fdm=central_fdm(5, 1), fkwargs=NamedTuple(), check_inferred=true, kwargs...)
test_scalar(f, z; rtol=1e-9, atol=0.0, fdm=central_fdm(5, 1), fkwargs=NamedTuple(), check_inferred=true, kwargs...)

Given a function `f` with scalar input and scalar output, perform finite differencing checks,
at input point `z` to confirm that there are correct `frule` and `rrule`s provided.
Expand All @@ -14,7 +14,7 @@ at input point `z` to confirm that there are correct `frule` and `rrule`s provid
- If `check_inferred=true`, then the inferrability (type-stability) of the `frule` and `rrule` are checked.
- All remaining keyword arguments are passed to `isapprox`.
"""
function test_scalar(f, z; rtol=1e-9, atol=1e-9, fdm=_fdm, fkwargs=NamedTuple(), check_inferred=true, kwargs...)
function test_scalar(f, z; rtol=1e-9, atol=0.0, fdm=_fdm, fkwargs=NamedTuple(), check_inferred=true, kwargs...)
# To simplify some of the calls we make later lets group the kwargs for reuse
rule_test_kwargs = (; rtol=rtol, atol=atol, fdm=fdm, fkwargs=fkwargs, check_inferred=check_inferred, kwargs...)
isapprox_kwargs = (; rtol=rtol, atol=atol, kwargs...)
Expand Down Expand Up @@ -106,7 +106,7 @@ function test_frule(
check_inferred::Bool=true,
fkwargs::NamedTuple=NamedTuple(),
rtol::Real=1e-9,
atol::Real=1e-9,
atol::Real=0.0,
kwargs...,
)
# To simplify some of the calls we make later lets group the kwargs for reuse
Expand Down Expand Up @@ -183,7 +183,7 @@ function test_rrule(
check_inferred::Bool=true,
fkwargs::NamedTuple=NamedTuple(),
rtol::Real=1e-9,
atol::Real=1e-9,
atol::Real=0.0,
kwargs...,
)
# To simplify some of the calls we make later lets group the kwargs for reuse
Expand Down