This is not intended behavior. Thank you for the bug report.
For now you can do
import torch.nn as nn
L = nn.Linear(5,5)
nn.init.eye_(L.weight)
L.weight.requires_grad_() # Enable requires_grad
as a workaround.
This is not intended behavior. Thank you for the bug report.
For now you can do
import torch.nn as nn
L = nn.Linear(5,5)
nn.init.eye_(L.weight)
L.weight.requires_grad_() # Enable requires_grad
as a workaround.