Skip to content

Examples for pytorch backend throwing error if run with GPU #389

@sahahner

Description

@sahahner

In the scripts exemplify the use of PyTorch in combination with POT, the torch.Generator() is always created on the CPU, which leads to an error if a GPU is available.

To reproduce the error run the example script 'plot_sliced_wass_grad_flow_pytorch.py' with an available GPU.

This is easily fixed by changing
gen = torch.Generator()
to
gen = torch.Generator(device=device)
in lines 77 and 139 of the script.
The same has to be done in the example jupyter notebook.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions