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

Einsum fails with repeated inputs #1217

Open
ricardoV94 opened this issue Feb 18, 2025 · 0 comments
Open

Einsum fails with repeated inputs #1217

ricardoV94 opened this issue Feb 18, 2025 · 0 comments

Comments

@ricardoV94
Copy link
Member

Description

import pytensor.tensor as pt

x = pt.matrix("x")
pt.einsum("ij,ij->i", x, x.copy())  # Fine
pt.einsum("ij,ij->i", x, x)  # Raises
ValueError: The following variables were provided more than once as inputs to the OpFromGraph, resulting in an invalid graph: [x]. Use dummy variables or var.copy() to distinguish variables when creating the OpFromGraph graph.

We should add an x.copy() internally, since this is an implementation detail

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

No branches or pull requests

1 participant