feat: add a to.(device) method for the BoxUniform prior
This branch attempts to add a to(device) to BoxUniform
https://github.com/jorobledo/sbi/tree/device
This is the relevant commit
I thought of two solutions and added a test in the tests folder tests/device_test.py.
There is an inplace replacemente method .to(device and also another option which is ._to(device), which is not inplace, but needs to be assigned to a new variable. Something like
prior = prior._to(device)
instead of
prior.to(device)
The thing is that in the tests, the assignment method samples way faster than the inplace option (both show a speedup in comparison to "cpu"). Tested it on mps device and gpu.
What do you think?
fixed with #1505