mirror of https://github.com/llvm/torch-mlir
ac4d7d10e0
Prior to this patch, the canonicalizers for `AtenSizeOp` and `AtenSizeIntOp` succeeded only if the tensor operand's type information included the size of the requested dimension(s). We can extend the set of optimizable cases by propagating types across operations whose result type matches the input tensor type. Specifically, this patch enables the canonicalizers for `AtenSizeOp` and `AtenSizeIntOp` to see past `tensor_static_info_cast`, `copy.to_vtensor`, and `copy.to_tensor` ops until it reaches the first op whose result type contains size information for the requested dimensions, with a maximum bound of 6 parent lookups to avoid indefinite compilation times. All other encountered ops cause the canonicalizer to give up. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
TorchDialect.cpp | ||
TorchOps.cpp | ||
TorchOpsODSGenerated.cpp | ||
TorchTypes.cpp | ||
UtilsForODSGenerated.cpp | ||
UtilsForODSGenerated.h |