File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 3333import cvxpy as cp
3434import numpy as np
3535import torch
36- from cvxpy import Expression
36+ from cvxpy import Expression , SolverError
3737from torch import Tensor
3838
3939from ._aggregator_bases import WeightedAggregator
@@ -170,8 +170,8 @@ def _solve_optimization(self, gtg: np.ndarray) -> np.ndarray:
170170
171171 try :
172172 self .prob .solve (solver = cp .ECOS , warm_start = True , max_iters = 100 )
173- except Exception :
174- # On macOS, this can happen with a cvxpy.error.SolverError : Solver 'ECOS' failed.
173+ except SolverError :
174+ # On macOS, this can happen with: Solver 'ECOS' failed.
175175 # No idea why. The corresponding matrix is of shape [9, 11] with rank 5.
176176 # Maybe other exceptions can happen in other cases.
177177 self .alpha_param .value = self .prvs_alpha_param .value
You can’t perform that action at this time.
0 commit comments