Dear Mr. Ptrblck,
Yes, I have run your code example. I agree with “The weight parameter as well as the gradient should be set to zero for the marked positions.”
However,  in this:with torch.no_grad():
self.fc1.weight.mul_(mask)
Does this mean to all the weight of fc1 are set to masked region?
Also include this:
Zero out gradients
with torch.no_grad():
    model.fc1.weight.grad.mul_(mask)

In my understanding, the weight that fc1 layer has connected able to backward its weight.
Maybe there is a deviation in my understanding.
Thank you again for all !!!
Thank you very much!!