Skip to content

Commit 9451251

Browse files
committed
Fix shape printing in _debugprint to check for presence of shape attribute
1 parent c8d262a commit 9451251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytensor/printing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def _debugprint(
543543
else:
544544
type_str = ""
545545

546-
if print_shape:
546+
if print_shape and hasattr(var.type, "shape"):
547547
shape_str = f" shape={str(var.type.shape).replace('None', '?')}"
548548
else:
549549
shape_str = ""

0 commit comments

Comments
 (0)