torch.nn.init.constant_
Fill the input Tensor with the value val.
Parameters
tensorTensor- An n-dimensional Tensor
valnumber- The value to fill the tensor with
Returns
Tensor– The input tensor filled with the constant valueExamples
const w = torch.empty(3, 5);
torch.nn.init.constant_(w, 0.3);