Commit 25f81c28 authored by Yusu Pan's avatar Yusu Pan Committed by Soumith Chintala
Browse files

fix unbroadcastable UserWarning in inception.py (#231)

parent eafab6bf
......@@ -62,6 +62,7 @@ class Inception3(nn.Module):
stddev = m.stddev if hasattr(m, 'stddev') else 0.1
X = stats.truncnorm(-2, 2, scale=stddev)
values = torch.Tensor(X.rvs(m.weight.data.numel()))
values = values.view(m.weight.data.size())
m.weight.data.copy_(values)
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment