提交 d5cf7da5 authored 作者: Li's avatar Li 提交者: Frederic

pickle unpickle work with two shared vars

上级 696312d8
......@@ -1243,7 +1243,7 @@ class FunctionMaker(object):
optimizer_profile = optimizer(fgraph)
end_optimizer = time.time()
opt_time = end_optimizer - start_optimizer
print 'opt took %s' % opt_time
#print 'opt took %s' % opt_time
if profile:
profile.optimizer_time += opt_time
if theano.config.profile_optimizer:
......
......@@ -7,10 +7,13 @@ import cPickle
floatX = 'float32'
def test_pickle_unpickle():
# Test if pick and unpickling a theano function with
# shared variables work
x1 = T.fmatrix('x1')
x2 = T.fmatrix('x2')
x3 = theano.shared(numpy.ones((10,10),dtype=floatX))
y = T.sum(T.sum(x1**2+x2) + x3)
x4 = theano.shared(numpy.ones((10,10),dtype=floatX))
y = T.sum(T.sum(T.sum(x1**2+x2) + x3) + x4)
f = theano.function([x1,x2],y)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论