torch.nn.init.
constant_
(tensor, val)[source]
用值val填充向量。
参数:
- tensor – an n-dimensional torch.Tensor
- val – the value to fill the tensor with
例:
>>> w = torch.empty(3, 5)
>>> nn.init.constant_(w, 0.3)
torch.nn.init.
constant_
(tensor, val)[source]
用值val填充向量。
参数:
例:
>>> w = torch.empty(3, 5)
>>> nn.init.constant_(w, 0.3)