Skip to content

Commit 42ef14a

Browse files
Fix deprecated usage of torch.nn.utils.weight_norm
The previous implementation in darts.darts.models.forecasting.tcn_mode was using `torch.nn.utils.weight_norm`, which is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`. This commit replaces two occurrences of `torch.nn.utils.weight_norm` with the recommended `torch.nn.utils.parametrizations.weight_norm` to resolve the deprecation warning.
1 parent 000d29d commit 42ef14a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

darts/models/forecasting/tcn_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def __init__(
9898
)
9999
if weight_norm:
100100
self.conv1, self.conv2 = (
101-
nn.utils.weight_norm(self.conv1),
102-
nn.utils.weight_norm(self.conv2),
101+
nn.utils.parametrizations.weight_norm(self.conv1),
102+
nn.utils.parametrizations.weight_norm(self.conv2),
103103
)
104104

105105
if input_dim != output_dim:

0 commit comments

Comments
 (0)