We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb3d7e7 commit e2e2c84Copy full SHA for e2e2c84
pytensor/tensor/optimize.py
@@ -712,6 +712,15 @@ def __init__(
712
jac: bool = True,
713
optimizer_kwargs: dict | None = None,
714
):
715
+ if variables.ndim != equations.ndim:
716
+ raise ValueError(
717
+ "The variable `variables` must have the same number of dimensions as the equations."
718
+ )
719
+ if variables not in ancestors([equations]):
720
721
+ "The variable `variables` must be an input to the computational graph of the equations."
722
723
+
724
self.fgraph = FunctionGraph([variables, *args], [equations])
725
726
if jac:
0 commit comments