Closed
Description
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