torch-mlir/lib/Dialect/Torch/IR
Ashay Rane 6491c69539
torch: use ScalarType enum instead of raw constants (#1020)
This patch replaces the use of raw integers like 6, 4, etc. (that
represent PyTorch's scalar types) with named values from the ScalarType
enum (e.g. `ScalarType::Float`, `ScalarType::Long`, etc.) in code for
folding `prim.dtype` ops into numeric constants.

This patch isn't strictly a non-functional change, since its use of
`Torch::getScalarTypeForType()` implies that the input type has to be
one among the supported types, otherwise compilation will abort, whereas
previously, compilation proceeded without folding the unsupported data
type into a numeric constant.
2022-07-07 14:21:05 -07:00
..
CMakeLists.txt Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00
TorchDialect.cpp llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
TorchOps.cpp torch: use ScalarType enum instead of raw constants (#1020) 2022-07-07 14:21:05 -07:00
TorchOpsODSGenerated.cpp Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00
TorchTypes.cpp Add support for ScalarType::QUInt8 2022-06-29 15:33:28 -07:00
UtilsForODSGenerated.cpp llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
UtilsForODSGenerated.h Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00