File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import importlib .util
2+
13import cvxpy as cp
24import numpy as np
35import torch
68from ._gramian_utils import compute_gramian , normalize
79from .bases import _WeightedAggregator , _Weighting
810
11+ # Check that the ecos solver is installed
12+ if importlib .util .find_spec ("ecos" ) is None :
13+ raise ModuleNotFoundError (
14+ "NashMTL requires the ecos solver, but it is not installed. Please run"
15+ "`pip install torchjd[nash_mtl]`."
16+ )
17+
918
1019class CAGrad (_WeightedAggregator ):
1120 """
Original file line number Diff line number Diff line change 2424# SOFTWARE.
2525
2626
27+ import importlib .util
28+
2729import cvxpy as cp
2830import numpy as np
2931import torch
3032from cvxpy import Expression
3133from torch import Tensor
3234
35+ # Check that the ecos solver is installed
36+ if importlib .util .find_spec ("ecos" ) is None :
37+ raise ModuleNotFoundError (
38+ "NashMTL requires the ecos solver, but it is not installed. Please run"
39+ "`pip install torchjd[nash_mtl]`."
40+ )
41+
3342from .bases import _WeightedAggregator , _Weighting
3443
3544
You can’t perform that action at this time.
0 commit comments