torch-mlir/frontends/pytorch/test/node_import
Sean Silva 784156a998 Add `!torch.bool` type.
This finishes removing the dependence on the basicpy dialect!

Changes:
- Add `!torch.bool` type and replace use of `!basicpy.BoolType` in
  Torch-related code.
- Rename BuiltinTensorize to BackendTypeConversion since now it handles
  bool conversions (and, when we add !torch.int and !torch.float, it
  will handle those as well), and generalize the related utilities (I
  also moved them to Torch/Transforms since they aren't really part of
  Torch/IR).
  - Add `torch.to_i1` and `torch.from_i1` ops for materializations
- [cleanup] Reorganize `torch.constant.*` ops in TorchOps.td
- Remove dependency of `torch` dialect on `basicpy` dialect and also
  `std` dialect. For `std`, we use some call related ops, but the
  `torch` dialect itself never produces them (we have passes that do
  though).

This is fairly mechanical. Recommended review order:
- New stuff in Torch/IR
- New BuiltinTypeConversion files.
- Mechnical fixups elsewhere.
2021-06-16 13:22:00 -07:00
..
README.md Rename tests to match the code they test 2021-02-25 13:31:33 -08:00
debug-info.py Properly model "derefinement". 2021-03-03 15:09:44 -08:00
elif.py Properly model "derefinement". 2021-03-03 15:09:44 -08:00
errors.py Properly model "derefinement". 2021-03-03 15:09:44 -08:00
function-derefine.py Introduce native `!torch.none` type. 2021-06-14 13:30:58 -07:00
if.py Add `!torch.bool` type. 2021-06-16 13:22:00 -07:00
list.py Add TorchList type and prim::ListConstruct #218 2021-06-10 14:31:35 -07:00
loop.py Add `!torch.bool` type. 2021-06-16 13:22:00 -07:00
prim.py Add `!torch.bool` type. 2021-06-16 13:22:00 -07:00
tuple.py Add `!torch.tuple<T1, T2>` type. 2021-06-15 08:15:22 -07:00
types-bool.py Add `!torch.bool` type. 2021-06-16 13:22:00 -07:00
types-none.py Introduce native `!torch.none` type. 2021-06-14 13:30:58 -07:00

README.md

node_import

Most of the tests in this directory test the importing of TorchScript torch::jit::Graph's.

However, TorchScript graphs don't really correspond directly to anything on the MLIR side. They are a weird combination of a context, builder, and function and just holds a torch::jit::Block. It is torch::jit::Node and torch::jit::Block which form the recursive structure analogous to MLIR's operation/region/block.

  • torch::jit::Node == mlir::Operation,
  • torch::jit::Block == mlir::Region containing single mlir::Block

Hence the name of this directory and the corresponding code in node_importer.h/cpp.