Open
Description
Describe the issue:
These are as expected:
from collections,abc import Iterable
>>> isinstance(pt.constant([1,2,3]), Iterable)
True
>>> isinstance(pytensor.shared(np.array([1,2,3])), Iterable)
True
But a purely symbolic at.vector()
that doesn't have a value yet raises and error when attempting to iterate it, because it has no length.
And even worse, a pt.scalar()
should never be iterable to begin with.
Reproducable code example:
>>> isinstance(pt.vector(), Iterable)
True
>>> isinstance(pt.scalar(), Iterable)
True
Error message:
No response
PyTensor version information:
main
Context for the issue:
No response