We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import numpy as np import pytensor.tensor as pt x = pt.tensor("x", shape=(0, 2)) pt.logsumexp(x).eval({x: np.zeros((0, 2))}) # ValueError: Input of CAReduce{maximum} has zero-size on axis %d
Interestingly, scipy has the same failure point
import numpy as np import scipy scipy.special.logsumexp(np.zeros((0, 2))) # ValueError: zero-size array to reduction operation maximum which has no identity
This is arguably an edge case. I think a good compromise is to reject the rewrite when the static size is 0, but not otherwise.
The text was updated successfully, but these errors were encountered:
Would the problem go away if we treat max([]) == -inf (at least for logsumexp)?
Sorry, something went wrong.
No branches or pull requests
Description
Interestingly, scipy has the same failure point
This is arguably an edge case. I think a good compromise is to reject the rewrite when the static size is 0, but not otherwise.
The text was updated successfully, but these errors were encountered: