From 983e73580d8d94ff9a6542f9f1cf6c45c5bf5dd7 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 26 Jun 2023 14:44:00 -0400 Subject: [PATCH] Revert "Update LuxDeviceUtils.jl" This reverts commit 023fb2a1d419749be75ca75dbce2982ccebe82b2. --- src/LuxDeviceUtils.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LuxDeviceUtils.jl b/src/LuxDeviceUtils.jl index 588fe59..ce35b91 100644 --- a/src/LuxDeviceUtils.jl +++ b/src/LuxDeviceUtils.jl @@ -224,12 +224,12 @@ struct LuxCUDAAdaptor <: AbstractLuxDeviceAdaptor end struct LuxAMDGPUAdaptor <: AbstractLuxDeviceAdaptor end struct LuxMetalAdaptor <: AbstractLuxDeviceAdaptor end -function adapt_structure(::LuxCPUAdaptor, +function adapt_storage(::LuxCPUAdaptor, x::Union{AbstractRange, SparseArrays.AbstractSparseArray}) return x end -adapt_structure(::LuxCPUAdaptor, x::AbstractArray) = adapt(Array, x) -adapt_structure(::LuxCPUAdaptor, rng::AbstractRNG) = rng +adapt_storage(::LuxCPUAdaptor, x::AbstractArray) = adapt(Array, x) +adapt_storage(::LuxCPUAdaptor, rng::AbstractRNG) = rng _isbitsarray(::AbstractArray{<:Number}) = true _isbitsarray(::AbstractArray{T}) where {T} = isbitstype(T)