提交 12ec5d30 authored 作者: Frederic's avatar Frederic

small test change to allow testing on the GPU.

上级 e2636bdc
...@@ -21,7 +21,7 @@ def test_profiling(): ...@@ -21,7 +21,7 @@ def test_profiling():
theano.config.profile_memory = True theano.config.profile_memory = True
theano.config.profiling.min_peak_memory = True theano.config.profiling.min_peak_memory = True
x = [T.dvector("val%i" % i) for i in range(3)] x = [T.fvector("val%i" % i) for i in range(3)]
z = [] z = []
z += [T.outer(x[i], x[i + 1]).sum(axis=1) for i in range(len(x) - 1)] z += [T.outer(x[i], x[i + 1]).sum(axis=1) for i in range(len(x) - 1)]
...@@ -37,7 +37,7 @@ def test_profiling(): ...@@ -37,7 +37,7 @@ def test_profiling():
f = theano.function(x, z, profile=p, name="test_profiling", f = theano.function(x, z, profile=p, name="test_profiling",
mode=m) mode=m)
inp = [numpy.arange(1024) + 1 for i in range(len(x))] inp = [numpy.arange(1024, dtype='float32') + 1 for i in range(len(x))]
output = f(*inp) output = f(*inp)
buf = StringIO.StringIO() buf = StringIO.StringIO()
...@@ -47,9 +47,9 @@ def test_profiling(): ...@@ -47,9 +47,9 @@ def test_profiling():
the_string = buf.getvalue() the_string = buf.getvalue()
lines1 = [l for l in the_string.split("\n") if "Max if linker" in l] lines1 = [l for l in the_string.split("\n") if "Max if linker" in l]
lines2 = [l for l in the_string.split("\n") if "Minimum peak" in l] lines2 = [l for l in the_string.split("\n") if "Minimum peak" in l]
assert "Max if linker=cvm(default): 8224KB (16408KB)" in the_string, ( assert "Max if linker=cvm(default): 4112KB (8204KB)" in the_string, (
lines1, lines2) lines1, lines2)
assert "Minimum peak from all valid apply node order is 8208KB" in the_string, ( assert "Minimum peak from all valid apply node order is 4104KB" in the_string, (
lines1, lines2) lines1, lines2)
finally: finally:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论