提交 ad06351a authored 作者: James Bergstra's avatar James Bergstra

compile module - updated tests to reflect .value copy semantics

上级 91253065
......@@ -285,7 +285,7 @@ class T_function(unittest.TestCase):
a = T.dmatrix()
f = function([a], Out(a, borrow=False))
o = N.ones((3,3))
assert o is f(o) #borrow does not imply copy.
assert o is not f(o) #function no longer permits aliasing outputs to inputs
f = function([a], Out(a*4, borrow=False))
o = N.ones((3,3))
......
......@@ -107,8 +107,8 @@ class Test_SharedVariable(unittest.TestCase):
# check that an assignment of a perfect value results in no copying
uval = theano._asarray([5,6,7,8], dtype='float64')
u.value = uval
assert u.value is uval
u.set_value(uval, borrow=True)
assert u.get_value(borrow=True) is uval
def test_scalar_strict(self):
def f(var, val): var.value = val
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论