I find the example in http://pytorch.org/docs/nn.html#torch-nn-init use nn.init.xavier_uniform
and so on.
The problem is that the torch.nn.init
must be imported manually, if someone tried from torch import nn
, he still can not use nn.init
immediately.