Skip to content

improve dtype conversion#4357

Merged
rijobro merged 8 commits intoProject-MONAI:devfrom
rijobro:dtype_conversion
May 26, 2022
Merged

improve dtype conversion#4357
rijobro merged 8 commits intoProject-MONAI:devfrom
rijobro:dtype_conversion

Conversation

@rijobro
Copy link
Copy Markdown
Contributor

@rijobro rijobro commented May 26, 2022

Description

Remove need for lookup table for dtype conversion. Create a zero-size array and convert to and from numpy/torch, as necessary. Also add functionality to create dtype from string, e.g., "float32" -> np.float32.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • New tests added to cover the changes.

Signed-off-by: Richard Brown <[email protected]>
@rijobro rijobro requested review from Nic-Ma, ericspod and wyli May 26, 2022 09:04
Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this type conversion is more robust than the current impl. cc @Nic-Ma in case you have any other comments

Signed-off-by: Richard Brown <[email protected]>
@rijobro rijobro enabled auto-merge (squash) May 26, 2022 16:25
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, put some minor comments inline.

Thanks.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented May 26, 2022

/build

@rijobro rijobro merged commit b6302d7 into Project-MONAI:dev May 26, 2022
@rijobro rijobro deleted the dtype_conversion branch May 27, 2022 10:22
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