You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix constructors for DenseNet derived classes (#5846)
### Description
We noted it was possible to instantiate classes derived from DenseNet
only if spatial_dims, in_channels, and out_channels parameters were
passed by keywords.
Passing them via positional scheme was not working.
This small bug should be fixed now.
### Example:
Before my fix:
```
import monai
net = monai.networks.nets.DenseNet(3,1,2) # Working
net = monai.networks.nets.DenseNet121(3,1,2) # NOT woking
net = monai.networks.nets.DenseNet121(spatial_dims=3, in_channels=1, out_channels=2) # Woking
```
After my fix:
```
import monai
net = monai.networks.nets.DenseNet121(3,1,2) # Woking
```
Thanks to @robsver for pointing this issue out.
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.
0 commit comments