torch-mlir/test/Dialect/Torch
Sean Silva a5fe0cf063 Introduce new shape library design.
See the documentation in `docs/shape_lib.md` and
`docs/adding_a_shape_function.md` for an overview of the system.

This completely overhauls how we represent shape functions. In
particular, RefineTypes does not infer shapes anymore (only dtypes).
Shape functions are now written in (TorchScript'able) Python.

Recommended review order:

1. Read `docs/shape_lib.md` and `docs/adding_a_shape_function.md`.
1. Code and tests for ReifyShapeCalculations, DropShapeCalculations.
1. Code and tests for SimplifyShapeCalculations.
1. shape_lib_gen.py
1. Code and tests for new RefineTypes pass.
1. Random folders/canonicalizers in TorchOps.cpp and associated test in
   `canonicalize.mlir`.
1. New ReadOnly trait inferred from the registry.
1. Any miscellaneous remaining stuff.

Example `-print-ir-after-all` for ElementwiseUnaryModule:
[IR lowering dump](https://gist.github.com/silvasean/e4dc8cbc8d00aac7819602e3cbd8e212).

Example `-print-ir-after-all` for ElementwiseBinaryModule:
[IR lowering dump](https://gist.github.com/silvasean/daf6860ecced732af3568af6b1899113).
2022-03-15 12:41:58 -07:00
..
GlobalizeObjectGraph Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
adjust-calling-conventions.mlir Add support for multiple return values 2021-11-16 21:07:45 -05:00
canonicalize.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
decompose-complex-ops.mlir [LINALG] Fix `aten.bernoulli` op lowering 2022-03-05 09:38:22 +05:30
drop-shape-calculations.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
inline-global-slots.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
invalid.mlir Add operand type invariant to `torch.overwrite.tensor.contents` (#606) 2022-02-22 11:41:46 -08:00
maximize-value-semantics.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
ops.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
prepare-for-globalize-object-graph.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
promote-types.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
reduce-op-variants-error.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
reduce-op-variants.mlir Add operand type invariant to `torch.overwrite.tensor.contents` (#606) 2022-02-22 11:41:46 -08:00
refine-public-return.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
refine-types-branch.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
refine-types-ops.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
refine-types.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
reify-shape-calculations.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00
simplify-shape-calculations.mlir Introduce new shape library design. 2022-03-15 12:41:58 -07:00