提交 c3e7b322 authored 作者: Roy Xue's avatar Roy Xue

reduce vector number

上级 46cef48e
...@@ -20,9 +20,8 @@ def test_profiling(): ...@@ -20,9 +20,8 @@ def test_profiling():
val3 = T.dvector("val3") val3 = T.dvector("val3")
val4 = T.dvector("val4") val4 = T.dvector("val4")
val5 = T.dvector("val5") val5 = T.dvector("val5")
val6 = T.dvector("val6")
x = [val1, val2, val3, val4, val5, val6] x = [val1, val2, val3, val4, val5]
z = [x[i] + x[i+1] for i in range(len(x)-1)] + [T.outer(x[i], x[i+1]).sum() for i in range(len(x)-1)] z = [x[i] + x[i+1] for i in range(len(x)-1)] + [T.outer(x[i], x[i+1]).sum() for i in range(len(x)-1)]
...@@ -33,10 +32,10 @@ def test_profiling(): ...@@ -33,10 +32,10 @@ def test_profiling():
else: else:
m = None m = None
f = theano.function([val1, val2, val3, val4, val5, val6], z, profile=p, name="test_profiling", f = theano.function([val1, val2, val3, val4, val5], z, profile=p, name="test_profiling",
mode=m) mode=m)
output = f([0, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7], [4, 5, 6, 7, 8], [5, 6, 7, 8, 9]) output = f([0, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7], [4, 5, 6, 7, 8])
buf = StringIO.StringIO() buf = StringIO.StringIO()
f.profile.summary(buf) f.profile.summary(buf)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论