提交 4a0f0342 authored 作者: Frederic Bastien's avatar Frederic Bastien

Don't catch interupt and remove import not used.

上级 f9813f0f
......@@ -702,7 +702,7 @@ def pydotprint_variables(vars,
config.device + '.' + format)
try:
import pydot as pd
except:
except ImportError:
print "failed to import pydot. Yous must install pydot for this function to work."
return
g=pd.Dot()
......
......@@ -264,7 +264,7 @@ def nvcc_module_compile_str(
continue
if l[l.index(':'):].startswith(': warning: label'):
continue
except:
except Exception:
pass
print >> sys.stderr, l
print >> sys.stderr, '==============================='
......
import sys, time
from theano.compile.sharedvalue import shared
from theano.compile.pfunc import pfunc
from theano import tensor
import numpy
import theano.sandbox.cuda as tcn
from theano.sandbox.cuda.basic_ops import host_from_gpu, gpu_from_host
def compare_fns(fns, input, reps=10):
times = {}
......@@ -15,7 +13,7 @@ def compare_fns(fns, input, reps=10):
print 'TOPOSORT', implname
for i, n in enumerate(impl.maker.env.toposort()):
print i, n
except:
except Exception:
pass
t0 = time.time()
for i in xrange(reps):
......
......@@ -12,7 +12,7 @@ from theano.gof.opt import Optimizer
try:
import scipy.linalg
except:
except ImportError:
pass # some ops (e.g. Cholesky) won't work
class Hint(Op):
......
......@@ -61,7 +61,7 @@ class SymbolicModule(object):
def issymbolicmodule(thing):
try:
return issubclass(thing, SymbolicModule)
except:
except Exception:
return False
def issymbolicmethod(thing):
......
......@@ -1104,7 +1104,7 @@ class Scan(PureOp):
# states) it is more of a safety check ( all random
# states should be after n_outs_not_shared ...
g_outs[i] = tensor.zeros_like(scan_outputs[i])
except:
except Exception:
g_outs[i] = theano.tensor.constant(
numpy.array(0, theano.config.floatX))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论