Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs code for ScaleIntensityRangePercentiles #6829

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

matt3o
Copy link
Contributor

@matt3o matt3o commented Aug 7, 2023

When running the docs code for ScaleIntensityRangePercentiles, it failed with the error (MONAI 1.2.dev2316):

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mhadlich/anaconda3/envs/monai/lib/python3.8/site-packages/monai/transforms/intensity/array.py", line 998, in __call__
    img_t = self._normalize(img=img_t)
  File "/home/mhadlich/anaconda3/envs/monai/lib/python3.8/site-packages/monai/transforms/intensity/array.py", line 971, in _normalize
    a_min: float = percentile(img, self.lower)  # type: ignore
  File "/home/mhadlich/anaconda3/envs/monai/lib/python3.8/site-packages/monai/transforms/utils_pytorch_numpy_unification.py", line 121, in percentile
    result = torch.quantile(x, q, dim=dim, keepdim=keepdim)
RuntimeError: quantile() input tensor must be either float or double dtype

This commit updates the docs for the function to use torch.Tensor instead.

Types of changes

  • 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.

Signed-off-by: Matthias Hadlich <matthiashadlich@posteo.de>
@matt3o matt3o marked this pull request as draft August 7, 2023 09:22
@matt3o matt3o marked this pull request as ready for review August 7, 2023 11:57
@wyli
Copy link
Contributor

wyli commented Aug 7, 2023

/build

@wyli wyli enabled auto-merge (squash) August 7, 2023 13:40
@wyli wyli merged commit 49a1ae5 into Project-MONAI:dev Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants