提交 454cfd37 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

use absolute reference for abs_

For some reason this was failing before
上级 d734be74
...@@ -6449,6 +6449,10 @@ class TestTensorInstanceMethods(unittest.TestCase): ...@@ -6449,6 +6449,10 @@ class TestTensorInstanceMethods(unittest.TestCase):
# Test equivalent advanced indexing # Test equivalent advanced indexing
assert_array_equal(X[:,indices].eval({X: x}), x[:,indices]) assert_array_equal(X[:,indices].eval({X: x}), x[:,indices])
def test_norm():
x = theano.tensor.vector('x')
x.norm(2)
if __name__ == '__main__': if __name__ == '__main__':
t = TestInferShape('setUp') t = TestInferShape('setUp')
......
...@@ -462,7 +462,8 @@ class _tensor_py_operators: ...@@ -462,7 +462,8 @@ class _tensor_py_operators:
raise NotImplementedError() raise NotImplementedError()
# optimizations will/should catch cases like L=1, L=2 # optimizations will/should catch cases like L=1, L=2
return theano.tensor.basic.pow( return theano.tensor.basic.pow(
theano.tensor.basic.pow(abs_(self), L).sum(axis=axis), 1.0 / L) theano.tensor.basic.pow(
theano.tensor.basic.abs_(self), L).sum(axis=axis), 1.0 / L)
def mean(self, axis=None, dtype=None, keepdims=False, acc_dtype=None): def mean(self, axis=None, dtype=None, keepdims=False, acc_dtype=None):
"""See `theano.tensor.mean`""" """See `theano.tensor.mean`"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论