diff --git a/frontends/pytorch/test/ivalue_import/README.md b/frontends/pytorch/test/ivalue_import/README.md new file mode 100644 index 000000000..388315957 --- /dev/null +++ b/frontends/pytorch/test/ivalue_import/README.md @@ -0,0 +1,10 @@ +# ivalue_import + +Most of the tests in this directory test importing of TorchScript +`torch::jit::Module`'s. + +Modules are just one of many types of c10::IValue's and recursively contain +c10::IValue's. Thus, the work of importing TorchScript modules is mainly +about importing the wide variety of possible c10::IValue's, hence the name +of this directory and the corresponding code in ivalue_importer.cpp that it +exercises. diff --git a/frontends/pytorch/test/module_import/annotations/class-annotator-repr.py b/frontends/pytorch/test/ivalue_import/annotations/class-annotator-repr.py similarity index 100% rename from frontends/pytorch/test/module_import/annotations/class-annotator-repr.py rename to frontends/pytorch/test/ivalue_import/annotations/class-annotator-repr.py diff --git a/frontends/pytorch/test/module_import/annotations/export-error.py b/frontends/pytorch/test/ivalue_import/annotations/export-error.py similarity index 100% rename from frontends/pytorch/test/module_import/annotations/export-error.py rename to frontends/pytorch/test/ivalue_import/annotations/export-error.py diff --git a/frontends/pytorch/test/module_import/annotations/export-recursive.py b/frontends/pytorch/test/ivalue_import/annotations/export-recursive.py similarity index 100% rename from frontends/pytorch/test/module_import/annotations/export-recursive.py rename to frontends/pytorch/test/ivalue_import/annotations/export-recursive.py diff --git a/frontends/pytorch/test/module_import/annotations/export.py b/frontends/pytorch/test/ivalue_import/annotations/export.py similarity index 100% rename from frontends/pytorch/test/module_import/annotations/export.py rename to frontends/pytorch/test/ivalue_import/annotations/export.py diff --git a/frontends/pytorch/test/module_import/list.py b/frontends/pytorch/test/ivalue_import/list.py similarity index 100% rename from frontends/pytorch/test/module_import/list.py rename to frontends/pytorch/test/ivalue_import/list.py diff --git a/frontends/pytorch/test/module_import/methods-debuggable-ir.py b/frontends/pytorch/test/ivalue_import/methods-debuggable-ir.py similarity index 100% rename from frontends/pytorch/test/module_import/methods-debuggable-ir.py rename to frontends/pytorch/test/ivalue_import/methods-debuggable-ir.py diff --git a/frontends/pytorch/test/module_import/methods-locations.py b/frontends/pytorch/test/ivalue_import/methods-locations.py similarity index 100% rename from frontends/pytorch/test/module_import/methods-locations.py rename to frontends/pytorch/test/ivalue_import/methods-locations.py diff --git a/frontends/pytorch/test/module_import/methods.py b/frontends/pytorch/test/ivalue_import/methods.py similarity index 100% rename from frontends/pytorch/test/module_import/methods.py rename to frontends/pytorch/test/ivalue_import/methods.py diff --git a/frontends/pytorch/test/module_import/object-identity-error-submodule.py b/frontends/pytorch/test/ivalue_import/object-identity-error-submodule.py similarity index 100% rename from frontends/pytorch/test/module_import/object-identity-error-submodule.py rename to frontends/pytorch/test/ivalue_import/object-identity-error-submodule.py diff --git a/frontends/pytorch/test/module_import/object-identity-error.py b/frontends/pytorch/test/ivalue_import/object-identity-error.py similarity index 100% rename from frontends/pytorch/test/module_import/object-identity-error.py rename to frontends/pytorch/test/ivalue_import/object-identity-error.py diff --git a/frontends/pytorch/test/module_import/object-identity-torch-bug.py b/frontends/pytorch/test/ivalue_import/object-identity-torch-bug.py similarity index 100% rename from frontends/pytorch/test/module_import/object-identity-torch-bug.py rename to frontends/pytorch/test/ivalue_import/object-identity-torch-bug.py diff --git a/frontends/pytorch/test/module_import/object-identity.py b/frontends/pytorch/test/ivalue_import/object-identity.py similarity index 100% rename from frontends/pytorch/test/module_import/object-identity.py rename to frontends/pytorch/test/ivalue_import/object-identity.py diff --git a/frontends/pytorch/test/module_import/prim.py b/frontends/pytorch/test/ivalue_import/prim.py similarity index 100% rename from frontends/pytorch/test/module_import/prim.py rename to frontends/pytorch/test/ivalue_import/prim.py diff --git a/frontends/pytorch/test/module_import/primitives.py b/frontends/pytorch/test/ivalue_import/primitives.py similarity index 100% rename from frontends/pytorch/test/module_import/primitives.py rename to frontends/pytorch/test/ivalue_import/primitives.py diff --git a/frontends/pytorch/test/module_import/submodules-select.py b/frontends/pytorch/test/ivalue_import/submodules-select.py similarity index 100% rename from frontends/pytorch/test/module_import/submodules-select.py rename to frontends/pytorch/test/ivalue_import/submodules-select.py diff --git a/frontends/pytorch/test/module_import/submodules.py b/frontends/pytorch/test/ivalue_import/submodules.py similarity index 100% rename from frontends/pytorch/test/module_import/submodules.py rename to frontends/pytorch/test/ivalue_import/submodules.py diff --git a/frontends/pytorch/test/module_import/tensors.py b/frontends/pytorch/test/ivalue_import/tensors.py similarity index 100% rename from frontends/pytorch/test/module_import/tensors.py rename to frontends/pytorch/test/ivalue_import/tensors.py diff --git a/frontends/pytorch/test/module_import/tuple.py b/frontends/pytorch/test/ivalue_import/tuple.py similarity index 100% rename from frontends/pytorch/test/module_import/tuple.py rename to frontends/pytorch/test/ivalue_import/tuple.py diff --git a/frontends/pytorch/test/node_import/README.md b/frontends/pytorch/test/node_import/README.md new file mode 100644 index 000000000..9d60f5d84 --- /dev/null +++ b/frontends/pytorch/test/node_import/README.md @@ -0,0 +1,16 @@ +# 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. diff --git a/frontends/pytorch/test/graph_import/add3.py b/frontends/pytorch/test/node_import/add3.py similarity index 100% rename from frontends/pytorch/test/graph_import/add3.py rename to frontends/pytorch/test/node_import/add3.py diff --git a/frontends/pytorch/test/graph_import/debug-info.py b/frontends/pytorch/test/node_import/debug-info.py similarity index 100% rename from frontends/pytorch/test/graph_import/debug-info.py rename to frontends/pytorch/test/node_import/debug-info.py diff --git a/frontends/pytorch/test/graph_import/elif.py b/frontends/pytorch/test/node_import/elif.py similarity index 100% rename from frontends/pytorch/test/graph_import/elif.py rename to frontends/pytorch/test/node_import/elif.py diff --git a/frontends/pytorch/test/graph_import/errors.py b/frontends/pytorch/test/node_import/errors.py similarity index 100% rename from frontends/pytorch/test/graph_import/errors.py rename to frontends/pytorch/test/node_import/errors.py diff --git a/frontends/pytorch/test/graph_import/if.py b/frontends/pytorch/test/node_import/if.py similarity index 100% rename from frontends/pytorch/test/graph_import/if.py rename to frontends/pytorch/test/node_import/if.py diff --git a/frontends/pytorch/test/graph_import/list.py b/frontends/pytorch/test/node_import/list.py similarity index 100% rename from frontends/pytorch/test/graph_import/list.py rename to frontends/pytorch/test/node_import/list.py diff --git a/frontends/pytorch/test/graph_import/tuple.py b/frontends/pytorch/test/node_import/tuple.py similarity index 100% rename from frontends/pytorch/test/graph_import/tuple.py rename to frontends/pytorch/test/node_import/tuple.py diff --git a/frontends/pytorch/test/graph_import/types-bool.py b/frontends/pytorch/test/node_import/types-bool.py similarity index 100% rename from frontends/pytorch/test/graph_import/types-bool.py rename to frontends/pytorch/test/node_import/types-bool.py diff --git a/frontends/pytorch/test/graph_import/types-none.py b/frontends/pytorch/test/node_import/types-none.py similarity index 100% rename from frontends/pytorch/test/graph_import/types-none.py rename to frontends/pytorch/test/node_import/types-none.py