Skip to content
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

Type checking for propagate kwargs. #133

Open
wants to merge 1 commit into
base: ag-propagatebind
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/propagate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ StochasticTriple of Int64:
"""
function propagate(f,
args...;
keep_deltas = Val(false),
keep_triples = Val(false),
keep_deltas::Val = Val(false),
keep_triples::Val = Val(false),
provided_st_rep = nothing,
deriv = nothing)
# TODO: support kwargs to f (or just use kwfunc in macro)
Expand Down
2 changes: 1 addition & 1 deletion test/triples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ end
out_δ_expected = StochasticAD.structural_map(zero, out)
end
input_sts = StochasticAD.structural_map(_form_triple, primals, δs, Δs)
out_st = StochasticAD.propagate(f, input_sts...; keep_deltas = Val{test_deltas})
out_st = StochasticAD.propagate(f, input_sts...; keep_deltas = Val(test_deltas))
# Test type
StochasticAD.structural_map(out_st, out, out_δ_expected,
out_Δ_expected) do x_st, x, δ, Δ
Expand Down
Loading