Skip to content

Is the use of torch.manual_seed in example training code correct? #175

@hysts

Description

@hysts

Describe the bug

generator = torch.manual_seed(0)

This is a minor thing, but I think this should be torch.Generator().manual_seed(0). In my understanding, if torch.manual_seed is called, it sets the seed globally and could cause unexpected side effect. I think it's better not to change the global seed in the training loop.

Reproduction

No response

Logs

No response

System Info

diffusers==0.1.3 (current `main` branch `92b6dbba1a` too)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions