Skip to content

Commit 5bbb199

Browse files
committed
fix: bool is deprecated in numpy
1 parent 5f5be12 commit 5bbb199

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pytensor/scalar/basic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,8 @@ def output_types(self, types):
11441144
def _cast_scalar(x, dtype):
11451145
if hasattr(x, "astype"):
11461146
return x.astype(dtype)
1147+
elif dtype == "bool":
1148+
return np.bool_(x)
11471149
else:
11481150
return getattr(np, dtype)(x)
11491151

0 commit comments

Comments
 (0)