I think this should be done during forward pass. Switching off means setting it’s value to zero?
If so, you would need to have a mask matrix which contains zeros and ones and you would have to multiply it to the outputs.
The only thing is, that you would have to update this mask by hand, as you cannot compute suitable gradients.