Skip to content

Commit 6c09b99

Browse files
authored
refactor: Make more things protected (#350)
* Make Aggregator modules protected * Make WeightedAggregator and GramianWeightedAggregator public * Make autojac modules protected * Make autojac protected * Make Transforms protected * Update rst files to use the new paths for newly protected modules * Add changelog entry
1 parent eb6e11f commit 6c09b99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+174
-173
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ changes that do not affect the user.
1414
TorchJD. Users of these aggregators will have to use `pip install torchjd[cagrad]`, `pip install
1515
torchjd[nash_mtl]` or `pip install torchjd[full]` to install TorchJD alongside those dependencies.
1616
This should make TorchJD more lightweight.
17+
- **BREAKING**: Made the aggregator modules and the `autojac` package protected. The aggregators
18+
must now always be imported via their package (e.g.
19+
`from torchjd.aggregation.upgrad import UPGrad` must be changed to
20+
`from torchjd.aggregation import UPGrad`). The `backward` and `mtl_backward` functions must now
21+
always be imported directly from the `torchjd` package (e.g.
22+
`from torchjd.autojac.mtl_backward import mtl_backward` must be changed to
23+
`from torchjd import mtl_backward`).
1724

1825
### Fixed
1926

docs/source/docs/aggregation/aligned_mtl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Aligned-MTL
44
===========
55

6-
.. automodule:: torchjd.aggregation.aligned_mtl
6+
.. autoclass:: torchjd.aggregation.AlignedMTL
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/bases.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Aggregator (abstract)
44
=====================
55

6-
.. automodule:: torchjd.aggregation.aggregator_bases
6+
.. autoclass:: torchjd.aggregation.Aggregator
77
:members:
88
:undoc-members:
99
:show-inheritance:

docs/source/docs/aggregation/cagrad.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
CAGrad
44
======
55

6-
.. automodule:: torchjd.aggregation.cagrad
6+
.. autoclass:: torchjd.aggregation.CAGrad
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ConFIG
44
======
55

6-
.. automodule:: torchjd.aggregation.config
6+
.. autoclass:: torchjd.aggregation.ConFIG
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/constant.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Constant
44
========
55

6-
.. automodule:: torchjd.aggregation.constant
6+
.. autoclass:: torchjd.aggregation.Constant
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/dualproj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DualProj
44
========
55

6-
.. automodule:: torchjd.aggregation.dualproj
6+
.. autoclass:: torchjd.aggregation.DualProj
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/graddrop.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
GradDrop
44
========
55

6-
.. automodule:: torchjd.aggregation.graddrop
6+
.. autoclass:: torchjd.aggregation.GradDrop
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/imtl_g.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
IMTL-G
44
======
55

6-
.. automodule:: torchjd.aggregation.imtl_g
6+
.. autoclass:: torchjd.aggregation.IMTLG
77
:members:
88
:undoc-members:
99
:exclude-members: forward

docs/source/docs/aggregation/krum.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Krum
44
====
55

6-
.. automodule:: torchjd.aggregation.krum
6+
.. autoclass:: torchjd.aggregation.Krum
77
:members:
88
:undoc-members:
99
:exclude-members: forward

0 commit comments

Comments
 (0)