Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use GPU to [chain1,chian2]? #594

Closed
Runfa-Zhang opened this issue Aug 25, 2022 · 1 comment
Closed

How to use GPU to [chain1,chian2]? #594

Runfa-Zhang opened this issue Aug 25, 2022 · 1 comment

Comments

@Runfa-Zhang
Copy link

Using GPUs

using Lux
chain = Chain(Dense(3,inner,Lux.σ),
              Dense(inner,inner,Lux.σ),
              Dense(inner,inner,Lux.σ),
              Dense(inner,inner,Lux.σ),
              Dense(inner,1)) 
ps = Lux.setup(Random.default_rng(), chain)[1]
ps = ps |> Lux.ComponentArray |> gpu .|> Float64

when chain=[chain1,chain2,...], how to use GPU?

@ChrisRackauckas
Copy link
Member

Just make ps be an array of gpu'd initialized values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants