提交 7e6ca506 authored 作者: Frederic Bastien's avatar Frederic Bastien

disable part of a test in debug mode that is test something debug don't need to conform.

上级 673ee5f8
...@@ -639,25 +639,27 @@ class Test_aliasing_rules(unittest.TestCase): ...@@ -639,25 +639,27 @@ class Test_aliasing_rules(unittest.TestCase):
assert not numpy.may_share_memory(data_of(A), data_of(B)) assert not numpy.may_share_memory(data_of(A), data_of(B))
# theano should have been smart enough to not make copies # theano should have been smart enough to not make copies
assert numpy.all(data_of(A) < 5) if theano.config.mode not in ['DebugMode', 'DEBUG_MODE']:
data_of_b += 10 #we don't ask DebugMode to don't make copy. We have the right to do so.
assert numpy.all(data_of(A) > 5) assert numpy.all(data_of(A) < 5)
data_of_b -= 10 data_of_b += 10
assert numpy.all(data_of(A) > 5)
assert numpy.all(data_of(B) < 5) data_of_b -= 10
data_of_a += 10
print data_of(B) assert numpy.all(data_of(B) < 5)
assert numpy.all(data_of(B) > 5) data_of_a += 10
data_of_a -= 10 print data_of(B)
assert numpy.all(data_of(B) > 5)
# N.B. may_share_memory is what we mean, but does it work? data_of_a -= 10
assert numpy.may_share_memory(data_of(A), data_of_b)
assert numpy.may_share_memory(data_of(B), data_of_a) # N.B. may_share_memory is what we mean, but does it work?
assert numpy.may_share_memory(data_of(A), data_of_b)
# N.B. This pattern could form a memory leak - each shared variable always points to a assert numpy.may_share_memory(data_of(B), data_of_a)
# view, and that view gets further and further from the (e.g. data_of_a) with each
# call. The memory leak is in the increasing number of view objects forming a chain to # N.B. This pattern could form a memory leak - each shared variable always points to a
# the underlying data. # view, and that view gets further and further from the (e.g. data_of_a) with each
# call. The memory leak is in the increasing number of view objects forming a chain to
# the underlying data.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论