torch-mlir/lib/Conversion
Ramiro Leal-Cavazos 73bd32d06c
Make `getTensorRank` safer by changing return to `Optional<unsigned>` (#1707)
Currently `getTensorRank` returns -1 if it was unable to get the rank
of the tensor. However, not every use in the codebase was checking the
return value, and in some cases, the return value was casted to
unsigned leading to some infinte loops when an unranked tensor reached
a decomposition.

This commit changes the return of `getTensorRank` to
`Optional<unsigned>` to make it clear to the user that the function
can fail.

This commit also changes a couple of for loops that iterate a vector
in reverse order that can potentially become infinite loops into
range-based for loops.
2022-12-12 08:56:28 -08:00
..
TorchConversionToMLProgram [MLIR][TORCH] Add TorchConversionToMLProgram and MLProgramBufferize pass 2022-12-02 13:20:46 +05:30
TorchToArith build: update llvm tag to 798fa4b4 (#1684) 2022-12-07 12:20:41 -08:00
TorchToLinalg build: update llvm tag to 798fa4b4 (#1684) 2022-12-07 12:20:41 -08:00
TorchToMhlo build: update llvm tag to 798fa4b4 (#1684) 2022-12-07 12:20:41 -08:00
TorchToSCF build: update llvm tag to 798fa4b4 (#1684) 2022-12-07 12:20:41 -08:00
TorchToTMTensor Make `getTensorRank` safer by changing return to `Optional<unsigned>` (#1707) 2022-12-12 08:56:28 -08:00
TorchToTosa [Bazel] Resolve circular dependency and add targets for conversion to MLProgram dialect (#1694) 2022-12-08 09:49:54 -08:00
Utils [Bazel] Resolve circular dependency and add targets for conversion to MLProgram dialect (#1694) 2022-12-08 09:49:54 -08:00
CMakeLists.txt [MLIR][TORCH] Add TorchConversionToMLProgram and MLProgramBufferize pass 2022-12-02 13:20:46 +05:30
PassDetail.h llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
Passes.cpp [MLIR][TORCH] Add TorchConversionToMLProgram and MLProgramBufferize pass 2022-12-02 13:20:46 +05:30