See the discussion: https://github.com/pymc-devs/pytensor/discussions/1636#discussioncomment-14626537