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

fix comments following previous code review.

上级 ab33e27f
...@@ -82,24 +82,24 @@ class T_updates(unittest.TestCase): ...@@ -82,24 +82,24 @@ class T_updates(unittest.TestCase):
def test_err_ndim(self): def test_err_ndim(self):
# Test that we raise a good error message when we don't # Test that we raise a good error message when we don't
# same the same number of dimensions. # have the same number of dimensions.
data = numpy.random.rand(10, 10).astype('float32') data = numpy.random.rand(10, 10).astype('float32')
output_var = f32sc(name="output", value=data) output_var = f32sc(name="output", value=data)
# the update_var has type matrix, and the update expression # the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should be allowed. # is a broadcasted scalar, and that should not be allowed.
self.assertRaises(TypeError, theano.function, inputs=[], outputs=[], self.assertRaises(TypeError, theano.function, inputs=[], outputs=[],
updates={output_var: updates={output_var:
output_var.sum()}) output_var.sum()})
def test_err_broadcast(self): def test_err_broadcast(self):
# Test that we raise a good error message when we don't # Test that we raise a good error message when we don't
# same the same number of dimensions. # have the same number of dimensions.
data = numpy.random.rand(10, 10).astype('float32') data = numpy.random.rand(10, 10).astype('float32')
output_var = f32sc(name="output", value=data) output_var = f32sc(name="output", value=data)
# the update_var has type matrix, and the update expression # the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should be allowed. # is a broadcasted scalar, and that should not be allowed.
self.assertRaises(TypeError, theano.function, inputs=[], outputs=[], self.assertRaises(TypeError, theano.function, inputs=[], outputs=[],
updates={output_var: updates={output_var:
output_var.sum().dimshuffle('x', 'x')}) output_var.sum().dimshuffle('x', 'x')})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论