torch.nn.utils.prune.remove¶
- torch.nn.utils.prune.remove(module, name)[source][source]¶
從模組中移除剪枝重引數化以及從前向鉤子中移除剪枝方法。
名為
name的已剪枝引數將永久保持剪枝狀態,而名為name+'_orig'的引數將從引數列表中移除。類似地,名為name+'_mask'的緩衝區將從緩衝區中移除。注意
剪枝操作本身**不會**被撤銷或反轉!
示例
>>> m = random_unstructured(nn.Linear(5, 7), name='weight', amount=0.2) >>> m = remove(m, name='weight')