def speed_local_log_erfc(self):
val = numpy.random.rand(1e6)
x = T.vector()
mode = theano.compile.mode.get_mode("FAST_RUN")
f1 = theano.function([x], T.log(T.erfc(x)), mode=mode.
excluding("local_log_erfc"))
f2 = theano.function([x], T.log(T.erfc(x)), mode=mode)
print(f1.maker.fgraph.toposort())
print(f2.maker.fgraph.toposort())
t0 = time.time()
f1(val)
t1 = time.time()
f2(val)
t2 = time.time()
print(t1 - t0, t2 - t1)
评论列表
文章目录