参考:https://pytorch.org/docs/stable/nn.html torch.nn.init.constant_(tensor, val) 使用参数val的值填满输入tensor 参数: tensor:一个n维的torch.Tensor val:用于填满tensor的值 举例: w = torch.empty(,) nn.init.constant_(w, 0.3) 返回: tensor([[0.3000, 0.3000, 0.3000, 0.3000, 0.3000], […