TypeError: cannot pickle 'fortran' object

From my latest poking around with pytensor while trying to get a reproducible code that fails, I think that I found the culprit of the issue you’ve been running into. It isn’t the Gemv Op as I wrote before, it looks like it’s Ger_scipy. For some reason that Op actually stores the Fortran object as an attribute to call it later during perform. That makes the whole Op impossible to pickle and raises this criptic error. I’ll work on a fix to push up to pytensor. Once that happens, @terrycojones, we might ask you to rerun your code using a newer version of pytensor.