From 35be39e54912c845e665ec6706c51fc232c51386 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Tue, 10 Sep 2024 21:04:32 +0530 Subject: [PATCH] Revert "[fximporter] Avoid importing from `_torchMlir` (#3685)" This reverts commit 2960538c6d145a2bd1efa52c56f2bcaa1ffc45aa. --- python/torch_mlir/extras/fx_importer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/torch_mlir/extras/fx_importer.py b/python/torch_mlir/extras/fx_importer.py index a8556c54d544..fe6f4df65fb0 100644 --- a/python/torch_mlir/extras/fx_importer.py +++ b/python/torch_mlir/extras/fx_importer.py @@ -135,6 +135,7 @@ func as func_dialect, ) +from .._mlir_libs._torchMlir import get_int64_max, get_int64_min __all__ = [ "FxImporter", @@ -1185,9 +1186,9 @@ def set_symbolic_guards( def _sympy_int_to_int(val: sympy.Expr, adjust_func: Callable): # Convert simple sympy Integers into concrete int if val in infs: - return torch.iinfo(torch.int64).max + return get_int64_max() if val in tuple(-inf for inf in infs): - return torch.iinfo(torch.int64).min + return get_int64_min() if isinstance(val, sympy.Integer): return int(val) # TODO: Remove this adjustment when fractional ranges are removed