pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Rewrite to remove useless Reshape

Open ricardoV94 opened this issue 8 months ago • 0 comments

Description

With static types it is possible to find out cases where we know the reshape is useless at compile time. We should remove it when that's the case.

Sometimes the Reshape may also just be expanding dims, pt.scalar().reshape(1, -1) (which showed up in the use of tensordot in #722), which should also be rewritten, as we have many rewrites that reason about Dimshuffles but not Reshapes

ricardoV94 avatar Jun 23 '24 16:06 ricardoV94