Sample multivariate normal with per-example standard deviation
Hi, I want to do something similar to this: <SCODE>mu = torch.zeros(5, 2)
sd = torch.ones(5)
torch.normal(mu, sd)
<ECODE> I noticed in the 1d case it works: <SCODE>mu = torch.zeros(5, 1)
sd = torch.ones(5)
torch.normal(mu, sd)
<ECODE>
solidor
solidor
apaszke
<SCODE>mu = Variable(torch.zeros(5, 2))
sd = Variable(torch.rand(5, 1))
torch.normal(mu, sd.expand_as(mu))
<ECODE>
solidor
Yes, expand will be much better! There will be no memory copy in this case.
apaszke