I want to create a random normal distribution in pytorch and mean and std are 4, 0.5 respectively. I didn\'t find a API for it. Anyone knows? Thanks very much.
For all distribution see: https://pytorch.org/docs/stable/distributions.html#
click on right menu to jump to normal (or search in the docs).
An example code:
import torch
num_samples = 3
Din = 1
mu, std = 0, 1
x = torch.distributions.normal.Normal(loc=mu, scale=std).sample((num_samples, Din))
print(x)
For details on torch distributions (with emphasis on uniform) see my SO answer here: https://stackoverflow.com/a/62919760/1601580