Skip to content

Commit 619fe66

Browse files
committed
Better guess for IterationError
1 parent f83c05b commit 619fe66

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pytensor/tensor/variable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,7 @@ def __iter__(self):
614614
# This prevents accidental iteration via sum(self)
615615
raise TypeError(
616616
"TensorType does not support iteration.\n"
617-
"\tDid you pass a PyTensor variable to a function that expects a list?\n"
618-
"\tMaybe you are using builtins.sum instead of pytensor.tensor.sum?"
617+
"\tDid you try to unpack a Variable or used a function that expects a list?\n"
619618
)
620619

621620
@property

0 commit comments

Comments
 (0)