Skip to content

Commit 2b0dcbb

Browse files
committed
Return from scalar constants in get_unique_constant_value
1 parent 6132203 commit 2b0dcbb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pytensor/tensor/variable.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,9 @@ def get_unique_constant_value(x: TensorVariable) -> Number | None:
10511051
if (flat_data == flat_data[0]).all():
10521052
return flat_data[0]
10531053

1054+
else:
1055+
return data
1056+
10541057
return None
10551058

10561059

0 commit comments

Comments
 (0)