-
Notifications
You must be signed in to change notification settings - Fork 143
Closed
Labels
Description
Description
SVD comes with a bunch of keyword arguments, most important of which is compute_uv
. If False, it will return only the singular values for a given matrix. This is nice if you want to save on computation, but it can actually be inefficient if the user wants gradients. In the reverse mode, we need to compute the U and V matrices anyway, and indeed the L_op
for SVD (added in #614 ) adds a 2nd SVD Op to the graph with compute_uv = True
When we see two SVD Ops with the same inputs on a graph, differing only by compute_uv
, we should change compute_uv = False
to True
everywhere. This will allow pytensor to see that these outputs are equivalent and re-use them, rather than computing the decomposition multiple times.