Skip to content

Commit

Permalink
[MLIR][TORCH] Fix typeConverted automatically convert the ui8 to i8
Browse files Browse the repository at this point in the history
  When converting vtenor to buildin tensor, the converter wrong convert the ui8 to i8.
  This will lead to other type cast issue in later usage of i8. Here is example:
  nod-ai/SHARK-Turbine#110
  • Loading branch information
AmosLewis authored and AmosLewis committed Nov 28, 2023
1 parent dc9ea08 commit 096db69
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Dialect/Torch/IR/TorchTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ static Type convertDtypeToBuiltinElementType(MLIRContext *context, Type dtype) {
if (auto floatType = dtype.dyn_cast<mlir::FloatType>()) {
return dtype;
} else if (auto integerType = dtype.dyn_cast<IntegerType>()) {
return IntegerType::get(context, integerType.getWidth(),
IntegerType::Signless);
return dtype;
} else if (dtype.isa<mlir::ComplexType>()){
return dtype;
}
Expand Down

0 comments on commit 096db69

Please sign in to comment.