File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from importlib .util import find_spec
22
3+ # Check that the clarabel solver is installed
4+ if find_spec ("clarabel" ) is None :
5+ raise ModuleNotFoundError (
6+ "CAGrad requires the clarabel solver, but it is not installed. Please run"
7+ "`pip install torchjd[cagrad]`."
8+ )
9+
310import cvxpy as cp
411import numpy as np
512import torch
815from ._gramian_utils import compute_gramian , normalize
916from .bases import _WeightedAggregator , _Weighting
1017
11- # Check that the clarabel solver is installed
12- if find_spec ("clarabel" ) is None :
13- raise ModuleNotFoundError (
14- "CAGrad requires the clarabel solver, but it is not installed. Please run"
15- "`pip install torchjd[cagrad]`."
16- )
17-
1818
1919class CAGrad (_WeightedAggregator ):
2020 """
Original file line number Diff line number Diff line change 2626
2727from importlib .util import find_spec
2828
29- import cvxpy as cp
30- import numpy as np
31- import torch
32- from cvxpy import Expression
33- from torch import Tensor
34-
3529# Check that the ecos solver is installed
3630if find_spec ("ecos" ) is None :
3731 raise ModuleNotFoundError (
3832 "NashMTL requires the ecos solver, but it is not installed. Please run"
3933 "`pip install torchjd[nash_mtl]`."
4034 )
4135
36+ import cvxpy as cp
37+ import numpy as np
38+ import torch
39+ from cvxpy import Expression
40+ from torch import Tensor
41+
4242from .bases import _WeightedAggregator , _Weighting
4343
4444
You can’t perform that action at this time.
0 commit comments