Complete distributions package

(solsol) #1

Hi,
How can I install distributions package for pytorch?

import torch.distributions
import torch.distributions.uniform
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘torch.distributions.uniform’; ‘torch.distributions’ is not a package

Thanks!

#2

Which PyTorch version are you using (print(torch.__version__))?
If you are using an older one, you could update it using the instructions on the website.

(solsol) #3

I need to use version 0.3.1

#4

A lot was added into PyTorch since 0.3.1.
Why do you have to use this old version?
If you need help porting your code, feel free to post it here or create a new topic.

(solsol) #5

Thanks @ptrblck

By updating torch version to 0.4, I would face some errors in some parts of the code. Such:

return x.cuda(self.primary_gpu, async=True)
SyntaxError: invalid syntax

#6

I could recommend to update to 1.1.0 and use the .to(device, non_blocking=True) method.
Have a look at the release notes for 0.4 to see some necessary changes. Also the most recent release notes will be useful.

1 Like
(solsol) #7

Thanks, anyway there is no way to use “distributions package” in pytorch 0.3?

#8

There are some distributions in 0.3.1 as seen here. However a lot of distributions were added after the 0.3.1 release.

1 Like