torch-mlir/frontends/pytorch/test/ivalue_import
Sean Silva 333e07a74e Add `torch.vtensor.literal` op.
This op is much better behaved than the `torch.tensor.literal` op
(which is the new name of the `torch.tensor` op). In particular
`torch.tensor.literal`:
- always has a maximally refined type.
- always has value semantics.
- can be constant folded / CSE'd.

ReduceOpVariants is changed to perform the transformation from
`torch.tensor.literal` to `torch.vtensor.literal` (which in general
involves static information casts and copies.

This new op also allowed tightening up `torch.tensor.literal` to only
accept NonValueTensorType (instead of any tensor type).

This new ".literal" name is more descriptive. It was getting too
confusing seeing an op called just `torch.tensor` (we originally called
it that because that's the name of the similar function in the Torch
Python API, but it just doesn't fit here).
2021-06-17 14:37:04 -07:00
..
annotations Add `!torch.int` type. 2021-06-17 07:28:23 -07:00
README.md Rename tests to match the code they test 2021-02-25 13:31:33 -08:00
functions-that-call-methods.py Introduce native `!torch.none` type. 2021-06-14 13:30:58 -07:00
functions.py Introduce `!torch.tensor` / `!torch.vtensor` types. 2021-06-10 10:56:48 -07:00
list.py Add `!torch.int` type. 2021-06-17 07:28:23 -07:00
methods-derefine.py Add `!torch.int` type. 2021-06-17 07:28:23 -07:00
methods-locations.py Rename tests to match the code they test 2021-02-25 13:31:33 -08:00
methods.py Introduce `!torch.tensor` / `!torch.vtensor` types. 2021-06-10 10:56:48 -07:00
object-identity-error-submodule.py Rename tests to match the code they test 2021-02-25 13:31:33 -08:00
object-identity-error.py Rename tests to match the code they test 2021-02-25 13:31:33 -08:00
object-identity-torch-bug.py Add TorchList type and prim::ListConstruct #218 2021-06-10 14:31:35 -07:00
object-identity.py Add `torch.vtensor.literal` op. 2021-06-17 14:37:04 -07:00
prim.py Introduce native `!torch.none` type. 2021-06-14 13:30:58 -07:00
primitives.py Add a !torch.float type. 2021-06-17 09:24:18 -07:00
quantization.py Add `torch.vtensor.literal` op. 2021-06-17 14:37:04 -07:00
strings.py Add !torch.str type. 2021-06-15 10:10:59 -07:00
submodules-select.py Add `torch.prim.If` 2021-06-16 14:04:31 -07:00
submodules.py Add `!torch.int` type. 2021-06-17 07:28:23 -07:00
tensors.py Add `torch.vtensor.literal` op. 2021-06-17 14:37:04 -07:00
tuple.py Add `!torch.int` type. 2021-06-17 07:28:23 -07:00

README.md

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.