Skip to content

Evaluating graph changes constants in place #347

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

Closed
ricardoV94 opened this issue Jun 16, 2023 · 1 comment · Fixed by #348
Closed

Evaluating graph changes constants in place #347

ricardoV94 opened this issue Jun 16, 2023 · 1 comment · Fixed by #348
Labels

Comments

@ricardoV94
Copy link
Member

Description

import pytensor.tensor as pt

x = pt.as_tensor(0)
x.name = "x"

y = pt.as_tensor(0)
y.name = "y"

assert y.name == "y"
assert x.name == "x"  # raises

(x + y).eval()

assert y.name == "y"
assert x.name == "x"  # raises
@ricardoV94
Copy link
Member Author

Seems to be caused by the MergeFeature here:

if c.name:
other_c.name = c.name

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

Successfully merging a pull request may close this issue.

1 participant