Skip to content

Commit

Permalink
[ET] Fix serde handling of inf
Browse files Browse the repository at this point in the history
Differential Revision: D65848116

Pull Request resolved: #6799
  • Loading branch information
SS-JIA authored Nov 13, 2024
1 parent dc41596 commit 1490d74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exir/serde/export_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,13 @@ def deserialize(
self.symbol_name_to_range = {}
if symbol_name_to_range:
for k, vr in symbol_name_to_range.items():
lower = int(vr.lower)
if math.isinf(vr.lower) and vr.lower < 0:
lower = -math.inf
elif math.isinf(vr.lower):
lower = math.inf
else:
lower = int(vr.lower)

if vr.upper >= 2: # max is >= 2, not sym bool range
lower = max(2, lower)
self.symbol_name_to_range[k] = symbolic_shapes.ValueRanges(
Expand Down

0 comments on commit 1490d74

Please sign in to comment.