The following code should make each one of the 100 5x5 matrices of the Parameter to be equal to its lower triangular, but for some reason it does not work, whilst it prints the contents
Do you maybe have any ideas why this is happening?
variable = Parameter(torch.randn(100, 5, 5).cuda(), requires_grad=True)
for i in range(0, 100):
    print(torch.tril(variable[i].data))
    variable[i].data = torch.tril(variable[i].data)