PyTorch将模型的weight和bias置零

代码

for k, v in model.named_parameters():
    v.data.zero_()

你可能感兴趣的:(PyTorch,pytorch,weight,bias)