Skip to content

Add safe_dtype_convert - #5620

Merged
wyli merged 13 commits into
Project-MONAI:devfrom
KumoLiu:convert-data-dtype
Dec 8, 2022
Merged

wyli merged 13 commits into
Project-MONAI:devfrom
KumoLiu:convert-data-dtype

Conversation

@KumoLiu

@KumoLiu KumoLiu commented Dec 1, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #5621 .

this also fixes #5685 by 0cf152e

Description

As stated in the issue, a warning is currently added to remind the user of the intensity overflow.
Add safe_dtype_convert
Add safe flag in convert_data_type, convert_to_tensor, convert_to_numpy, convert_to_cupy

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.

@KumoLiu KumoLiu changed the title Add warning in convert_data_type Add safe_dtype_convert Dec 5, 2022
@KumoLiu
KumoLiu marked this pull request as ready for review December 5, 2022 09:41
@KumoLiu
KumoLiu requested review from Nic-Ma, ericspod, rijobro and wyli and removed request for Nic-Ma December 5, 2022 09:41
Comment thread monai/utils/type_conversion.py Resolved
@wyli

wyli commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

/build

@wyli
wyli enabled auto-merge (squash) December 8, 2022 12:02
@wyli
wyli merged commit 0737a33 into Project-MONAI:dev Dec 8, 2022
@KumoLiu
KumoLiu deleted the convert-data-dtype branch December 8, 2022 13:21
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.

test_query_memory doesn't work for certain hardware config Intensity overflow in ShiftIntensity

2 participants