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

Commit

Permalink
Ambiguous method
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jun 23, 2023
1 parent 5630ef2 commit 1931951
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/LuxDeviceUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ Return a `LuxCPUDevice` object which can be used to transfer data to CPU.
(::LuxCUDADevice)(x) = fmap(x -> adapt(LuxCUDAAdaptor(), x), x; exclude=_isleaf)
(::LuxAMDGPUDevice)(x) = fmap(x -> adapt(LuxAMDGPUAdaptor(), x), x; exclude=_isleaf)

function (::AbstractLuxDevice)(::LuxCore.AbstractExplicitLayer)
throw(ArgumentError("Lux layers are stateless and hence don't participate in device transfers. Apply this function on the parameters and states generated using `Lux.setup`."))
for dev in (LuxCPUDevice, LuxCUDADevice, LuxAMDGPUDevice)
@eval begin
function (::$dev)(::LuxCore.AbstractExplicitLayer)
throw(ArgumentError("Lux layers are stateless and hence don't participate in device transfers. Apply this function on the parameters and states generated using `Lux.setup`."))
end
end
end

# Adapt Interface
Expand Down

2 comments on commit 1931951

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/86166

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 193195111f8bc83f148480dc43f4d09ac7f1ed22
git push origin v0.1.0

Please sign in to comment.