Skip to content

Commit 1227c4d

Browse files
pre-commit-ci[bot]jessegrabowski
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 488d058 commit 1227c4d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pytensor/tensor/optimize.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,9 @@ def __init__(
820820
self.fgraph = FunctionGraph([variables, *args], [equations])
821821

822822
if jac:
823-
jac_wrt_x = jacobian(self.fgraph.outputs[0], self.fgraph.inputs[0], vectorize=True)
823+
jac_wrt_x = jacobian(
824+
self.fgraph.outputs[0], self.fgraph.inputs[0], vectorize=True
825+
)
824826
self.fgraph.add_output(atleast_2d(jac_wrt_x))
825827

826828
self.jac = jac
@@ -900,8 +902,14 @@ def L_op(
900902
inner_x, *inner_args = self.fgraph.inputs
901903
inner_fx = self.fgraph.outputs[0]
902904

903-
df_dx = jacobian(inner_fx, inner_x, vectorize=True) if not self.jac else self.fgraph.outputs[1]
904-
df_dtheta_columns = jacobian(inner_fx, inner_args, disconnected_inputs="ignore", vectorize=True)
905+
df_dx = (
906+
jacobian(inner_fx, inner_x, vectorize=True)
907+
if not self.jac
908+
else self.fgraph.outputs[1]
909+
)
910+
df_dtheta_columns = jacobian(
911+
inner_fx, inner_args, disconnected_inputs="ignore", vectorize=True
912+
)
905913

906914
grad_wrt_args = implict_optimization_grads(
907915
df_dx=df_dx,

0 commit comments

Comments
 (0)