[MLIR][TORCH] Add support for unsigned integer types

Refer: https://github.com/pytorch/pytorch/issues/58734
pull/2590/head
Vivek Khandelwal 2023-11-21 15:36:34 +00:00
parent 03e8f99730
commit d50d3aa5e7
1 changed files with 4 additions and 1 deletions

View File

@ -200,7 +200,10 @@ static bool isValidTorchDtype(Type dtype) {
}
}
if (type.isUnsigned()) {
return type.getWidth() == 8 || type.getWidth() == 4;
for (unsigned width : {4, 8, 16, 32, 64}) {
if (type.getWidth() == width)
return true;
}
}
}
return false;