Skip to content

Commit a619fa7

Browse files
author
namgyu-youn
committed
Replcae torch.norm with torch.linalg.vector_norm in L1-norm
torch.norm is deprecated and may be removed in future PyTorch releases
1 parent 6badd1e commit a619fa7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modelopt/torch/nas/modules/conv.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,4 @@ def _estimate_importance(self) -> TracedHp.Importance:
251251
return None
252252
weight = self._parameters["weight"] # retrieve full weight tensor
253253
c_in = weight.shape[0]
254-
return torch.linalg.vector_norm(
255-
torch.reshape(weight.detach().transpose(0, 1), (c_in, -1)), dim=1
256-
)
254+
return torch.linalg.vector_norm(torch.reshape(weight.detach(), (c_in, -1)), dim=1)

0 commit comments

Comments
 (0)