For the correctness, yes it will work. Keep in mind that the values that you override will get 0 gradients ars they are not used anymore.
For the speed, it should not change much.
Can you give sample Tensors (generated with torch.rand) for example to make a runnable example that shows the slow down?