提交 b20bb36e authored 作者: amrithasuresh's avatar amrithasuresh

Updated numpy as np

上级 5698befd
...@@ -16,7 +16,7 @@ way (as scan does) to create a shared variable of this kind. ...@@ -16,7 +16,7 @@ way (as scan does) to create a shared variable of this kind.
""" """
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import numpy import numpy as np
from six import integer_types from six import integer_types
from theano.compile import SharedVariable from theano.compile import SharedVariable
...@@ -48,12 +48,12 @@ def shared(value, name=None, strict=False, allow_downcast=None): ...@@ -48,12 +48,12 @@ def shared(value, name=None, strict=False, allow_downcast=None):
We implement this using 0-d tensors for now. We implement this using 0-d tensors for now.
""" """
if not isinstance(value, (numpy.number, float, integer_types, complex)): if not isinstance(value, (np.number, float, integer_types, complex)):
raise TypeError() raise TypeError()
try: try:
dtype = value.dtype dtype = value.dtype
except AttributeError: except AttributeError:
dtype = numpy.asarray(value).dtype dtype = np.asarray(value).dtype
dtype = str(dtype) dtype = str(dtype)
value = getattr(numpy, dtype)(value) value = getattr(numpy, dtype)(value)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论