Description
Description
Join has a view flag that allows it to work inplace in one of the inputs if all the remaining ones have length 0 (are empty) along the axis. This happens at eval time, but pytensor needs to know the candidate input in advance with the view flag.
The only place where this is used is in scan_checkpoints
:
pytensor/pytensor/scan/checkpoints.py
Line 131 in b79d232
Funnily enough that code branch is completely broken, the code was never tested apparently. See a fix in: #754
Unlike theano, we have more static shapes than 1/None, so I suggest we get rid of this flag. We can have a rewrite that removes inputs with shape 0 along the axis from Join, and if all are removed the join is useless and can be discarded. This inplace is just a runtime version of this optimization.