Skip to content
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

Do not require rng in verify_grad #1089

Closed
ricardoV94 opened this issue Nov 13, 2024 · 0 comments · Fixed by #1093
Closed

Do not require rng in verify_grad #1089

ricardoV94 opened this issue Nov 13, 2024 · 0 comments · Fixed by #1093

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Nov 13, 2024

Description

Just create one on-demand np.random.default_rng(). No need to require it explicitly?

import pytensor.tensor as pt
from pytensor.gradient import verify_grad

verify_grad(pt.log, [2.0])
# TypeError: rng should be a valid instance of numpy.random.RandomState. You may want to use tests.unittest_tools.verify_grad instead of pytensor.gradient.verify_grad.

The message is also outdated, as numpy.random.Generator are accepted (and preferred)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant