Skip to content

Commit

Permalink
[cleanup] Change OutputType enum values to strings
Browse files Browse the repository at this point in the history
The use of numbers was arbitrary and was preventing the enum values from
being put in the natural order.
  • Loading branch information
silvasean committed Aug 24, 2022
1 parent 3d0e18b commit d7d6797
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/torch_mlir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ class OutputType(Enum):

# This output type consists of `torch` dialect ops that have been converted
# maximally to value semantics, decomposed, and shapes have been inferred.
TORCH = 0

# This output type consists of `tosa` dialect ops. It can be thought of
# as taking the `TORCH` output type and lowering it to TOSA.
TOSA = 1
TORCH = "torch"

# The output type contains a mix of `linalg`-on-tensors ops, `scf`, and
# `arith` ops (and also `math` and `tm_tensor`). It can be thought of
# as taking the `TORCH` output type and lowering it so that tensor
# computations are done with `linalg`-on-tensors ops.
LINALG_ON_TENSORS = 2
LINALG_ON_TENSORS = "linalg-on-tensors"

# Raw output of the JIT IR importer. This is not expected to be useful
# for end-users, but can be convenient for development or reporting bugs.
RAW = 3
# This output type consists of `tosa` dialect ops. It can be thought of
# as taking the `TORCH` output type and lowering it to TOSA.
TOSA = "tosa"

# This output type consists of `mhlo` dialect ops. It can be thought of
# This output type consists of `mhlo` dialect ops. It can be thought of
# as taking the `TORCH` output type and lowering it to MHLO.
MHLO = 4
MHLO = "mhlo"

# Raw output of the JIT IR importer. This is not expected to be useful
# for end-users, but can be convenient for development or reporting bugs.
RAW = "raw"

@staticmethod
def get(spec: Union[str, "OutputType"]) -> "OutputType":
Expand Down

0 comments on commit d7d6797

Please sign in to comment.