From 7202dbcc187dc276e8193731c965bf6d23733385 Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Fri, 18 Oct 2024 20:22:15 +0200 Subject: [PATCH] exclude --- src/public.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public.jl b/src/public.jl index 4111dba..379aea9 100644 --- a/src/public.jl +++ b/src/public.jl @@ -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