-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify dots with 1 #638
Comments
Looks like an interesting issue. We'd just have to replace 0 with x in the
However, I think using constant value might be wrong here. Will I have to replace with the entire var itself? If yes, then is this the correct way of moving forward?
|
No, the rule is slightly different for ones, as it consists of summing the left matrix. Also have to reason about broadcasting. I suggest playing with numpy to get a feel of what it should do. |
Ohk.
we want the output of the rewrite to be:
Is this correct? And if yes, how does summing of left matrices and broadcasting come into picture here? |
Description
We have a
local_0_dot_x
that removes useless dots with zero'd inputs. We don't seem to have anything for dots with ones as reported in #637 (comment)I excluded the BlasOpt just to have a simpler graph, but it will still not rewrite it away with those, just add the more complex Blas Op.
pytensor/pytensor/tensor/rewriting/math.py
Lines 155 to 190 in d3dd34e
The text was updated successfully, but these errors were encountered: