Skip to content

Commit

Permalink
update the docstring for HoVerNet and UpSample (#5818)
Browse files Browse the repository at this point in the history
Signed-off-by: KumoLiu <[email protected]>

Fixes #5609.

### Description
Update the docstring for `HoVerNet` and `UpSample`.

### 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`.
- [x] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: KumoLiu <[email protected]>
  • Loading branch information
KumoLiu authored Jan 6, 2023
1 parent c7bc1bf commit 2c2de9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions monai/networks/blocks/upsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class UpSample(nn.Sequential):
- "nontrainable": uses :py:class:`torch.nn.Upsample`.
- "pixelshuffle": uses :py:class:`monai.networks.blocks.SubpixelUpsample`.
This operation will cause non-deterministic when ``mode`` is ``UpsampleMode.NONTRAINABLE``.
Please check the link below for more details:
https://pytorch.org/docs/stable/generated/torch.use_deterministic_algorithms.html#torch.use_deterministic_algorithms
This module can optionally take a pre-convolution
(often used to map the number of features from `in_channels` to `out_channels`).
"""
Expand Down
4 changes: 4 additions & 0 deletions monai/networks/nets/hovernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ class HoVerNet(nn.Module):
https://github.com/vqdang/hover_net
https://pytorch.org/vision/main/models/generated/torchvision.models.resnet50.html
This network is non-deterministic since it uses `torch.nn.Upsample` with ``UpsampleMode.NONTRAINABLE`` mode which
is implemented with torch.nn.functional.interpolate(). Please check the link below for more details:
https://pytorch.org/docs/stable/generated/torch.use_deterministic_algorithms.html#torch.use_deterministic_algorithms
Args:
mode: use original implementation (`HoVerNetMODE.ORIGINAL` or "original") or
a faster implementation (`HoVerNetMODE.FAST` or "fast"). Defaults to `HoVerNetMODE.FAST`.
Expand Down

0 comments on commit 2c2de9e

Please sign in to comment.