提交 f540041b authored 作者: Matthew Rocklin's avatar Matthew Rocklin

compile and run test_norm function

上级 454cfd37
...@@ -6451,7 +6451,9 @@ class TestTensorInstanceMethods(unittest.TestCase): ...@@ -6451,7 +6451,9 @@ class TestTensorInstanceMethods(unittest.TestCase):
def test_norm(): def test_norm():
x = theano.tensor.vector('x') x = theano.tensor.vector('x')
x.norm(2) n = x.norm(2)
f = theano.function([x], n)
assert numpy.allclose(f([1, 1]), numpy.sqrt(2))
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论