avoid codacy warning

This commit is contained in:
Dario Coscia
2025-05-05 10:55:56 +02:00
parent aa2ba5fc7f
commit 6b355b45de

View File

@@ -150,16 +150,16 @@ class PODBlock(torch.nn.Module):
"This may slow down computations.", "This may slow down computations.",
ResourceWarning, ResourceWarning,
) )
u, s, v = torch.svd(X.T) u, s, _ = torch.svd(X.T)
else: else:
if randomized: if randomized:
warnings.warn( warnings.warn(
"Considering a randomized algorithm to compute the POD basis" "Considering a randomized algorithm to compute the POD basis"
) )
u, s, v = torch.svd_lowrank(X.T, q=X.shape[0]) u, s, _ = torch.svd_lowrank(X.T, q=X.shape[0])
else: else:
u, s, v = torch.svd(X.T) u, s, _ = torch.svd(X.T)
self._basis = u.T self._basis = u.T
self._singular_values = s self._singular_values = s