Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Mooncake"
uuid = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
authors = ["Will Tebbutt, Hong Ge, and contributors"]
version = "0.4.148"
version = "0.4.149"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
10 changes: 5 additions & 5 deletions src/tools_for_rules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,8 @@ function _zero_derivative_impl(ctx, sig, mode)
# which does not escape the mode argument. This will work even if the names `Mooncake`
# or `Mooncake.Mode` are not available in the scope which calls this macro.
is_primitive_ex = quote
const M = $mode
function Mooncake.is_primitive(
::Type{$(esc(ctx))}, ::Type{<:M}, ::Type{<:$(esc(sig))}
::Type{$(esc(ctx))}, ::Type{<:$mode}, ::Type{<:$(esc(sig))}
)
return true
end
Expand Down Expand Up @@ -605,7 +604,9 @@ function _from_chainrules_impl(ctx, sig::Expr, has_kwargs::Bool, mode)
kw_sig = where_params === nothing ? kw_sig : Expr(:where, kw_sig, where_params...)
# Type M will be available later on, and will be the mode type.
kw_is_primitive = quote
function Mooncake.is_primitive(::Type{$(esc(ctx))}, ::Type{<:M}, ::Type{<:$kw_sig})
function Mooncake.is_primitive(
::Type{$(esc(ctx))}, ::Type{<:$mode}, ::Type{<:$kw_sig}
)
return true
end
end
Expand Down Expand Up @@ -634,9 +635,8 @@ function _from_chainrules_impl(ctx, sig::Expr, has_kwargs::Bool, mode)
end

return quote
const M = $mode
function Mooncake.is_primitive(
::Type{$(esc(ctx))}, ::Type{<:M}, ::Type{<:($(esc(sig)))}
::Type{$(esc(ctx))}, ::Type{<:$mode}, ::Type{<:($(esc(sig)))}
)
return true
end
Expand Down
Loading