You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytensor.tensor.cartesian does not work on TensorVariables
Reproduceable code example:
a=pm.Normal("a", shape=(7,))
b=pm.Normal("b", shape=(2,7))
pm.math.cartesian(a, b).shape.eval()
# Throws an error# I need [7,2,7]pytensor.tensor.mul(a,b).shape()
# [2,7] <- not what I need
Error message:
Traceback (most recent call last):
File "<string>", line 1, in<module>
File "/opt/anaconda3/envs/dev_refactor_2/lib/python3.12/site-packages/pymc/math.py", line 214, in cartesian
arrays_integer = [np.arange(len(x)) forxin arrays_2d]
^^^^^^
TypeError: len() of unsized object
PyMC version information:
5.19.1 conda
Context for the issue:
I don't know if there is another way to do this, but I have two TensorVariables with possibly matching dimension lengths, and I need the cartesian product of them. I can't seem to find a way to let the matching dimensions be combined.
The text was updated successfully, but these errors were encountered:
AuguB
changed the title
BUG: <Please write a comprehensive title after the 'BUG: ' prefix>
pytensor.tensor.cartesian does not work on TensorVariables
Jan 6, 2025
Describe the issue:
pytensor.tensor.cartesian does not work on TensorVariables
Reproduceable code example:
Error message:
PyMC version information:
5.19.1 conda
Context for the issue:
I don't know if there is another way to do this, but I have two TensorVariables with possibly matching dimension lengths, and I need the cartesian product of them. I can't seem to find a way to let the matching dimensions be combined.
The text was updated successfully, but these errors were encountered: