Skip to content

Commit

Permalink
[MAINT] Support python 3.12 (#667)
Browse files Browse the repository at this point in the history
* support Python 3.12

* run unit tests on Python 3.12

* update dependencies to be compatible with 3.12

* bump torch

* use np.prod instead of np.product which was removed in Numpy 2
  • Loading branch information
NicolasGensollen authored Oct 11, 2024
1 parent 41824d6 commit 3c40944
Show file tree
Hide file tree
Showing 4 changed files with 555 additions and 449 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion clinicadl/utils/network/cnn/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def fc_dict_design(n_fcblocks, convolutions, initial_shape, n_classes=2):
out_channels = last_conv["out_channels"]
flattened_shape = np.ceil(np.array(initial_shape) / 2**n_conv)
flattened_shape[0] = out_channels
in_features = np.product(flattened_shape)
in_features = np.prod(flattened_shape)

# Sample number of FC layers
ratio = (in_features / n_classes) ** (1 / n_fcblocks)
Expand Down
Loading

0 comments on commit 3c40944

Please sign in to comment.