提交 cc8bfdee authored 作者: Frederic Bastien's avatar Frederic Bastien

code cleanup

上级 a5df8d99
...@@ -709,27 +709,17 @@ class test_fusion(unittest.TestCase): ...@@ -709,27 +709,17 @@ class test_fusion(unittest.TestCase):
if shared_fn == None: if shared_fn == None:
assert gpu==False assert gpu==False
f = compile.function(list(sym_inputs), g,mode=mode) f = compile.function(list(sym_inputs), g,mode=mode)
#pre-call to have the data in cache if it fit to don't penalise the first iteration
# if id==0:
# out=f(*val_inputs)
t0=time.time()
for x in range(nb_repeat): for x in range(nb_repeat):
out=f(*val_inputs) out=f(*val_inputs)
t1=time.time() t1=time.time()
nb_repeat=1
else: else:
out=shared_fn(numpy.zeros(shp, dtype=out_dtype),'out') out=shared_fn(numpy.zeros(shp, dtype=out_dtype),'out')
f = function(sym_inputs,[],updates=[(out,out+g)],mode=mode) f = function(sym_inputs,[],updates=[(out,out+g)],mode=mode)
#pre-call to have the data in cache if it fit to don't penalise the first iteration
# if id==0:
# f(*val_inputs)
t0=time.time() t0=time.time()
for x in range(nb_repeat): for x in range(nb_repeat):
f(*val_inputs) f(*val_inputs)
t1=time.time() t1=time.time()
out=out.value out=out.value
# if id==0:
# nb_repeat+=1
times[id]=t1-t0 times[id]=t1-t0
atol=1e-8 atol=1e-8
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论