I implemented a similar version to gradients update correctly (based on the top publication) after set some weights to zero. This update works because gradient must be variables or None:
    for l,p in enumerate(net.parameters()):
        gradient_mask = (p!=0).data # Assuming some weights in 0
        p.grad = Variable(gradient_mask.float() * p.grad.data)

you are right in the first comment, and I am agree. The algorithm takes the same time as the non-pruned version, due to I continue computing the gradients in zero weights.
However in this:

I believe pruning the gradients using your code will result in the wrong update.

My original model had 91.77% accuracy, after pruning, the my model had 71.78%. I retrained the model (without updating the zero weights and setting gradients to zero) and I got 92.18% for 25 epochs using lr=0.05 with SGD  and learning rate is divided by 10 in 3, 10, 16 epoch. I’m not sure if it is a fine-tuning, but I improved the previous result. 
Moreover, could you explain a little bit more the example you gave? I get lose in some part when I try to employ it in my model.
Thank you in advance