If you are using a momentum in the optimizer and had previous valid updates for these parameters, they’ll still be updated as seen here:
# no momentum
x = torch.ones(1, 5, requires_grad=True)
optimizer = torch.optim.SGD([x], lr=0.1, momentum=0.)

# perform a valid update
print('no momentum, valid update')
x.grad = torch.ones_like(x)
print(x)
optimizer.step()
print(x)

# zero out gradients and check, if parameter is still updated
for _ in range(3):
    print('no momentum, update with zero grad')
    x.grad = torch.zeros_like(x)
    print(x)
    optimizer.step()
    print(x)

# with momentum
optimizer = torch.optim.SGD([x], lr=0.1, momentum=0.1)

# perform a valid update
print('momentum, valid update')
x.grad = torch.ones_like(x)
print(x)
optimizer.step()
print(x)

# zero out gradients and check, if parameter is still updated
for _ in range(3):
    print('momentum, update with zero grad')
    x.grad = torch.zeros_like(x)
    print(x)
    optimizer.step()
    print(x)

Output:
no momentum, valid update
tensor([[1., 1., 1., 1., 1.]], requires_grad=True)
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
no momentum, update with zero grad
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
no momentum, update with zero grad
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
no momentum, update with zero grad
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
momentum, valid update
tensor([[0.9000, 0.9000, 0.9000, 0.9000, 0.9000]], requires_grad=True)
tensor([[0.8000, 0.8000, 0.8000, 0.8000, 0.8000]], requires_grad=True)
momentum, update with zero grad
tensor([[0.8000, 0.8000, 0.8000, 0.8000, 0.8000]], requires_grad=True)
tensor([[0.7900, 0.7900, 0.7900, 0.7900, 0.7900]], requires_grad=True)
momentum, update with zero grad
tensor([[0.7900, 0.7900, 0.7900, 0.7900, 0.7900]], requires_grad=True)
tensor([[0.7890, 0.7890, 0.7890, 0.7890, 0.7890]], requires_grad=True)
momentum, update with zero grad
tensor([[0.7890, 0.7890, 0.7890, 0.7890, 0.7890]], requires_grad=True)
tensor([[0.7889, 0.7889, 0.7889, 0.7889, 0.7889]], requires_grad=True)