pyro-ppl / pyro

Deep universal probabilistic programming with Python and PyTorch
http://pyro.ai
Apache License 2.0
8.59k stars 987 forks source link

fix autodetermination of plate device when running in a device contexf #3405

Closed ilia-kats closed 1 month ago

ilia-kats commented 1 month ago

Apparently, the torch.Tensor() constructor ignores device contexts, e.g. running

with torch.device("cuda"):
    print(torch.Tensor().device)

still returns cpu.

ilia-kats commented 1 month ago

The CI is failing in files that this PR does not touch. Let me know if I should still fix it.

ordabayevy commented 1 month ago

Thanks for the fix! Could you merge the dev branch that should fix the CI errors.