Skip to content

Commit 15c5716

Browse files
authored
Don't re-wrap exceptions in exc.TorchOpTracingError (#84)
1 parent 6eb66f2 commit 15c5716

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

helion/_compiler/type_propagation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ def propagate_unary(self, op: ast.unaryop, origin: Origin) -> TypeInfo:
424424
return SymBoolType.new_unbacked(origin)
425425
try:
426426
return TypeInfo.from_example(_eval_unary(op, self.fake_value), origin)
427+
except exc.Base:
428+
raise
427429
except Exception as e:
428430
raise exc.TorchOpTracingError(e) from e
429431

@@ -1564,6 +1566,8 @@ def _compare(self, op: ast.cmpop, left: TypeInfo, right: TypeInfo) -> TypeInfo:
15641566
_eval_compare(op, left_example, right_example),
15651567
self.origin(),
15661568
)
1569+
except exc.Base:
1570+
raise
15671571
except Exception as e:
15681572
raise exc.TorchOpTracingError(e) from e
15691573
if isinstance(left, UnknownType):
@@ -1733,6 +1737,8 @@ def visit_BinOp(self, node: ast.BinOp) -> TypeInfo:
17331737
_eval_binary(node.op, left_example, right_example),
17341738
self.origin(),
17351739
)
1740+
except exc.Base:
1741+
raise
17361742
except Exception as e:
17371743
raise exc.TorchOpTracingError(e) from e
17381744

0 commit comments

Comments
 (0)