-
Notifications
You must be signed in to change notification settings - Fork 30
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
Interaction with ChainRulesCore.@non_differentiable
#642
Comments
Argh. Even putting the |
Closed
julia> @macroexpand @non_differentiable f(x::Int)
quote
#= /Users/aviatesk/.julia/packages/ChainRulesCore/I1EbV/src/rule_definition_tools.jl:383 =#
begin
function (::(ChainRulesCore.Core).kwftype(ChainRulesCore.typeof((ChainRulesCore.ChainRulesCore).frule)))($(Expr(:meta, :nospecialize, :(var"##kwargs#238"::Any))), var"#214#frule"::ChainRulesCore.typeof((ChainRulesCore.ChainRulesCore).frule), $(Expr(:meta, :nospecialize, :(::Tuple))), ::(Core).Typeof(f), x::Int)
return (f(x; var"##kwargs#238"...), ChainRulesCore.NoTangent())
end
function (ChainRulesCore.ChainRulesCore).frule($(Expr(:meta, :nospecialize, :(::Tuple))), ::(Core).Typeof(f), x::Int)
#= REPL[17]:1 =#
return (f(x), ChainRulesCore.NoTangent())
end
end
#= /Users/aviatesk/.julia/packages/ChainRulesCore/I1EbV/src/rule_definition_tools.jl:384 =#
begin
function (::(ChainRulesCore.Core).kwftype(ChainRulesCore.typeof(ChainRulesCore.rrule)))(var"##kwargs#239"::ChainRulesCore.NamedTuple, ::ChainRulesCore.typeof(ChainRulesCore.rrule), ::(Core).Typeof(f), x::Int)
return (f(x; var"##kwargs#239"...), begin
ChainRulesCore.Returns((ChainRulesCore.NoTangent(), ChainRulesCore.NoTangent()))
end)
end
function (ChainRulesCore.ChainRulesCore).rrule(::(Core).Typeof(f), x::Int)
#= REPL[17]:1 =#
return (f(x), begin
ChainRulesCore.Returns((ChainRulesCore.NoTangent(), ChainRulesCore.NoTangent()))
end)
end
end
end and it looks like the generated code contains unnecessary definitions that handle non-existing keyword arguments. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a package, put the following code:
then, analyze the package with
report_package(MyPackage; target_defined_modules=true)
.The following errors will be shown on Julia 1.10 (here, using it in the package
DynamicExpressions
)So there's some weird interaction with ChainRuleCore. Since the
@non_differentiable f(x::Int)
looks about as constrained as possible (docs), I'm not sure what else to do.This is flagging my package here: SymbolicML/DynamicExpressions.jl#90 from some real-world use-cases and not sure how to disable it without disabling JET altogether.
The text was updated successfully, but these errors were encountered: