提交 5912cfe0 authored 作者: Frederic Bastien's avatar Frederic Bastien

print config before compiling in case it crash during compilation.

上级 adbc78dd
...@@ -37,14 +37,6 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, ...@@ -37,14 +37,6 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
str that represents the implementation used) str that represents the implementation used)
""" """
a = theano.shared(numpy.ones((M, N), dtype=theano.config.floatX,
order=order))
b = theano.shared(numpy.ones((N, K), dtype=theano.config.floatX,
order=order))
c = theano.shared(numpy.ones((M, K), dtype=theano.config.floatX,
order=order))
f = theano.function([], updates={c: 0.4 * c + .8 * T.dot(a, b)})
if verbose: if verbose:
print 'Some Theano flags:' print 'Some Theano flags:'
print ' blas.ldflags=', theano.config.blas.ldflags print ' blas.ldflags=', theano.config.blas.ldflags
...@@ -62,8 +54,15 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, ...@@ -62,8 +54,15 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
print 'Numpy location:', numpy.__file__ print 'Numpy location:', numpy.__file__
print 'Numpy version:', numpy.__version__ print 'Numpy version:', numpy.__version__
print print
t0 = 0
t1 = -1 a = theano.shared(numpy.ones((M, N), dtype=theano.config.floatX,
order=order))
b = theano.shared(numpy.ones((N, K), dtype=theano.config.floatX,
order=order))
c = theano.shared(numpy.ones((M, K), dtype=theano.config.floatX,
order=order))
f = theano.function([], updates={c: 0.4 * c + .8 * T.dot(a, b)})
if any([x.op.__class__.__name__ == 'Gemm' for x in if any([x.op.__class__.__name__ == 'Gemm' for x in
f.maker.env.toposort()]): f.maker.env.toposort()]):
...@@ -75,6 +74,9 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, ...@@ -75,6 +74,9 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
impl = 'ERROR, unable to tell if Theano used the cpu or the gpu:\n' impl = 'ERROR, unable to tell if Theano used the cpu or the gpu:\n'
impl += str(f.maker.env.toposort()) impl += str(f.maker.env.toposort())
t0 = 0
t1 = -1
if execute: if execute:
t0 = time.time() t0 = time.time()
for i in range(iters): for i in range(iters):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论