Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Define isleaf #84

Merged
merged 9 commits into from
Oct 19, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
exclude
  • Loading branch information
CarloLucibello committed Oct 18, 2024
commit 7202dbcc187dc276e8193731c965bf6d23733385
2 changes: 1 addition & 1 deletion src/public.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ for (dev) in (:CPU, :CUDA, :AMDGPU, :Metal, :oneAPI, :XLA)
(D::$(ldev))(x::Union{Tuple, NamedTuple}) = map(D, x)
function (D::$(ldev))(x)
isleaf(x) && return Adapt.adapt(D, x)
return Functors.fmap(D, x)
return Functors.fmap(D, x, exclude=isleaf)
end
end
end
Expand Down