提交 dc9da377 authored 作者: Frederic's avatar Frederic

better comment.

上级 bfdfa507
...@@ -193,8 +193,9 @@ def test_container_deepcopy(): ...@@ -193,8 +193,9 @@ def test_container_deepcopy():
This is a test to a work around a NumPy bug. This is a test to a work around a NumPy bug.
""" """
t = theano.tensor.scalar() t = theano.tensor.scalar()
# It seam that astype() can return a numpy scalar with some NumPy Version. # It seam that numpy.asarray(0.).astype(floatX) can return a numpy
# So we must call numpy.asarray with the dtype parameter. # scalar with some NumPy Version. So we call numpy.asarray with
# the dtype parameter.
v = numpy.asarray(0., dtype=theano.config.floatX) v = numpy.asarray(0., dtype=theano.config.floatX)
assert isinstance(v, numpy.ndarray), type(v) assert isinstance(v, numpy.ndarray), type(v)
for readonly in [True, False]: for readonly in [True, False]:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论