I have found some perfect answers to my question, 1 but I am really afraid of latent bugs such as the Autograd problem,  so could you please kindly tell me

if the  line4 in the following codes is ok? Would the torch.from_numpy create a new node in graph and make the grad of ‘conv.weight’ change because I use torch.from_numpy()?
Supposed temp_state_dict['conv.weight'].shape==[16,3,3,3], what can I do to make the gradinet of  first 8 filters to be 0 thus stop only part of the weight updating?

temp_state_dict = model.state_dict()  # line1
weight_numpy = temp_state_dict['conv.weight'].cpu().numpy() # line 2
# ....Processing weight_numpy such as Pruning.... # line3
temp_state_dict['conv.weight'] = torch.from_numpy(weight_numpy) # line4
model.load_state_dict(temp_state_dict) # line5