提交 c28db533 authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Fix numpy DeprecationWarning when converting integers to PyTensor Constants

上级 7301a45e
...@@ -32,7 +32,7 @@ def _asarray(a, dtype, order=None): ...@@ -32,7 +32,7 @@ def _asarray(a, dtype, order=None):
if str(dtype) == "floatX": if str(dtype) == "floatX":
dtype = config.floatX dtype = config.floatX
dtype = np.dtype(dtype) # Convert into dtype object. 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` # Note that dtype comparison must be done by comparing their `num`
# attribute. One cannot assume that two identical data types are pointers # 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 # towards the same object (e.g. under Windows this appears not to be the
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论