The re-initialization was in the original code snippet before the edit:
for epoch in range(100):
    print("Epoch", epoch)
    correct = 0
    total = 0

    optimizer = optim.Adam(model.parameters(), lr=0.002)
    ...