Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Question about Accelerator usage #17

@MohitLamba94

Description

@MohitLamba94

Since you are using

model, opt, loader = accelerator.prepare(model, opt, loader)

do we really need the following,

model = model.to(device)

x = x.to(device)

y = y.to(device)

According to official documentation
https://huggingface.co/docs/accelerate/en/basic_tutorials/migration#training-loop
these appear to be redundant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions