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

Add test of profiling.

上级 b47081f2
"""
Test of memory profiling
"""
import theano
import theano.tensor as T
import StringIO
def test_profiling():
old1 = theano.config.profile
old2 = theano.config.profile_memory
theano.config.profile = True
theano.config.profile_memory = True
x = T.dvector("x")
y = T.dvector("y")
z = x + y
f = theano.function([x, y], z, profile=True, name="test_profiling")
output = f([1, 2, 3, 4],[1, 1, 1, 1])
buf = StringIO.StringIO()
f.profile.summary(buf)
theano.config.profile = old1
theano.config.profile_memory = old2
test_profiling()
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论