Skip to content

Commit 2e721b9

Browse files
committed
fix torch patch
1 parent 6237a78 commit 2e721b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

onnx_diagnostic/torch_export_patches/patches/patch_torch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ def _set_replacement(
205205
# Precondition: a == tgt
206206
assert isinstance(a, sympy.Symbol)
207207

208-
if self.allow_complex_guards_as_runtime_asserts and not _is_supported_equivalence(tgt):
208+
if (
209+
getattr(self, "allow_complex_guards_as_runtime_asserts", False)
210+
or getattr(self, "prefer_deferred_runtime_asserts_over_guards", False)
211+
) and not _is_supported_equivalence(tgt):
209212
# continuing leads to placeholder shapes
210213
# having complex expressions that we can't resolve
211214
return

0 commit comments

Comments
 (0)