Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging

Home Page:https://monai.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support more dtypes in `pad_nd`

function2-llx opened this issue · comments

To be brief, I just have no idea why torch.bool (and other integer dtypes except for torch.int32) is considered to be not supported by PyTorch (it seems to work for me with PyTorch 2.3). I will be glad to add a PR.

if mode in {"constant", "reflect", "edge", "replicate", "wrap", "circular"} and img.dtype not in {
torch.int16,
torch.int64,
torch.bool,
torch.uint8,
}: