From f815e46bb7d074a70425a9c573006f10881c0bf7 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Fri, 4 Dec 2020 11:41:33 +0000 Subject: [PATCH 1/2] Make sure pullbacks from scalar_rule's inline --- src/rule_definition_tools.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rule_definition_tools.jl b/src/rule_definition_tools.jl index 7ff595ff5..aeed853a5 100644 --- a/src/rule_definition_tools.jl +++ b/src/rule_definition_tools.jl @@ -184,7 +184,7 @@ function scalar_rrule_expr(f, call, setup_stmts, inputs, partials) # Multi-output functions have pullbacks with a tuple input that will be destructured pullback_input = n_outputs == 1 ? first(Δs) : Expr(:tuple, Δs...) pullback = quote - function $(esc(propagator_name(f, :pullback)))($pullback_input) + @inline function $(esc(propagator_name(f, :pullback)))($pullback_input) return (NO_FIELDS, $(pullback_returns...)) end end @@ -408,4 +408,4 @@ function _constrain_and_name(arg::Expr, _) Meta.isexpr(arg, :(...), 1) && return Expr(:(...), _constrain_and_name(arg.args[1], :Any)) error("malformed arguments: $arg") end -_constrain_and_name(name::Symbol, constraint) = Expr(:(::), name, constraint) # add type \ No newline at end of file +_constrain_and_name(name::Symbol, constraint) = Expr(:(::), name, constraint) # add type From c807f78de553089e804bf0c49c4aa506cf43e010 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Fri, 4 Dec 2020 14:21:10 +0000 Subject: [PATCH 2/2] bump version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ffb470fa7..b43a7b306 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ChainRulesCore" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.22" +version = "0.9.23" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"