Error when constructing scan - AssertionError: (CumOp{None, add}(Alloc.0), 'float64') #615
Unanswered
emilio-cartoni
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm asking help for an error on pytensor.scan that I can't solve.
I have built the following function (an implementation of Chinese Restauarant Process to be used in PyMC):
The above code works well, however to use it in PyMC I have to pass this dist function to the CustomDist class of PyMC, which will try to initialize the graph by passing to dist the following arguments <Scalar(int64, shape=())> <Vector(int64, shape=(0,))> which then cause an error.
The error can be reproduced manually by doing:
which gives:
I tried to change many things on the scan function (e.g. I removed a non-sequence argument, I tried to ensure correct dtype was returned, I tried make the
n_steps
fixed using a shared variable..) but nothing worked so far.In particular, from the AssertionError I don't think I have understood properly what's the problem here, so I am working in the dark.
Can anyone shed some light for me?
Thanks! :)
Note: I originally posted this on PyMC (link) but I thought I'd repost it here as the error is actually from pytensor.
Note2: On https://pytensor.readthedocs.io/en/latest/index.html the "Visit pytensor-users" link is broken, it leads to a community that according to gitter does not exist.
Beta Was this translation helpful? Give feedback.
All reactions