From 5d575a8035d291e28ba7cebb43d35c0582d77160 Mon Sep 17 00:00:00 2001 From: qihqi Date: Wed, 4 Dec 2024 14:29:30 -0800 Subject: [PATCH] Update torch version to 2.5.1 (#8452) --- experimental/torch_xla2/dev-requirements.txt | 4 ++-- experimental/torch_xla2/torch_xla2/export.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/experimental/torch_xla2/dev-requirements.txt b/experimental/torch_xla2/dev-requirements.txt index 70dc73047d2..6195bcd3a1b 100644 --- a/experimental/torch_xla2/dev-requirements.txt +++ b/experimental/torch_xla2/dev-requirements.txt @@ -1,4 +1,4 @@ -f https://download.pytorch.org/whl/torch -torch==2.4.0; sys_platform == 'darwin' # macOS -torch==2.4.0+cpu; sys_platform != 'darwin' # Non-macOS (CPU-only), like on TPU +torch==2.5.1; sys_platform == 'darwin' # macOS +torch==2.5.1+cpu; sys_platform != 'darwin' # Non-macOS (CPU-only), like on TPU ruff~=0.3.5 diff --git a/experimental/torch_xla2/torch_xla2/export.py b/experimental/torch_xla2/torch_xla2/export.py index 3fdbedc8474..2d9c1684697 100644 --- a/experimental/torch_xla2/torch_xla2/export.py +++ b/experimental/torch_xla2/torch_xla2/export.py @@ -169,9 +169,10 @@ def _build_symbolic_constraints(symbol_name, torch_constraint): symbol = sympy.Symbol(symbol_name) if torch_constraint.lower != 2: constraints.append(symbol >= torch_constraint.lower) - if not torch_constraint.upper.is_infinite: + from sympy.core.singleton import S + if not torch_constraint.upper.is_infinite and torch_constraint.upper is not S.IntInfinity: constraints.append(symbol <= torch_constraint.upper) - + return tuple(sympy.pretty(c, use_unicode=False) for c in constraints) def _build_symbolic_shape(sym, constraint, free_symbols):