Skip to content

Commit

Permalink
Fix numpy DeprecationWarning when converting integers to PyTensor Con…
Browse files Browse the repository at this point in the history
…stants
  • Loading branch information
ricardoV94 committed Mar 9, 2023
1 parent 7301a45 commit c28db53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytensor/misc/safe_asarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _asarray(a, dtype, order=None):
if str(dtype) == "floatX":
dtype = config.floatX
dtype = np.dtype(dtype) # Convert into dtype object.
rval = np.asarray(a, dtype=dtype, order=order)
rval = np.asarray(a, order=order).astype(dtype)
# Note that dtype comparison must be done by comparing their `num`
# attribute. One cannot assume that two identical data types are pointers
# towards the same object (e.g. under Windows this appears not to be the
Expand Down

0 comments on commit c28db53

Please sign in to comment.