Skip to content

Commit bfa63f6

Browse files
Fix bug when minimize gets scalar input
1 parent 0cd959e commit bfa63f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytensor/tensor/optimize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def perform(self, node, inputs, outputs):
503503

504504
f.clear_cache()
505505

506-
outputs[0][0] = res.x.astype(x0.dtype)
506+
outputs[0][0] = res.x.reshape(x0.shape).astype(x0.dtype)
507507
outputs[1][0] = np.bool_(res.success)
508508

509509
def L_op(self, inputs, outputs, output_grads):

0 commit comments

Comments
 (0)