Is your feature request related to a problem? Please describe.
As numpy array can accept the dtype arg in string, so many previous programs use dtype="float32" in the MONAI transforms. If we put ToTensor before the transform to make it work on GPU Tensor, it will fail because PyTorch Tensor doesn't support string for dtype.
It broken many NVIDIA Clara MMARs when switching to GPU transforms.
Would be nice to enhance the get_equivalent_dtype utility to properly convert the string dtype of numpy array for PyTorch Tensor.
Is your feature request related to a problem? Please describe.
As numpy array can accept the
dtypearg in string, so many previous programs usedtype="float32"in the MONAI transforms. If we putToTensorbefore the transform to make it work on GPU Tensor, it will fail because PyTorch Tensor doesn't support string for dtype.It broken many NVIDIA Clara MMARs when switching to GPU transforms.
Would be nice to enhance the
get_equivalent_dtypeutility to properly convert the string dtype of numpy array for PyTorch Tensor.