提交 0925ce7a authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Auto indentation.

上级 115c38aa
......@@ -61,9 +61,9 @@ class SymbolicInput(object):
raise TypeError("name must be a string! (got: %s)" % self.name)
self.update = update
if (mutable is not None):
self.mutable = mutable
self.mutable = mutable
else:
self.mutable = (update is not None)
self.mutable = (update is not None)
self.strict = strict
self.allow_downcast = allow_downcast
......@@ -255,5 +255,3 @@ class SymbolicOutput(object):
return "Out(%s,%s)" % (self.variable, self.borrow)
Out = SymbolicOutput
......@@ -113,7 +113,7 @@ def get_home_dir():
home = os.getenv('USERPROFILE')
assert home is not None
return home
AddConfigVar('home',
"User home directory",
StrParam(get_home_dir()),
......
......@@ -7,7 +7,7 @@ class CallCache(object):
self.filename = filename
try:
if filename is None:
raise IOError('bad filename') #just goes to except
raise IOError('bad filename') #just goes to except
f = file(filename, 'r')
self.cache = cPickle.load(f)
f.close()
......@@ -16,7 +16,7 @@ class CallCache(object):
def persist(self, filename=None):
if filename is None:
filename = self.filename
filename = self.filename
#backport
#filename = self.filename if filename is None else filename
......@@ -26,7 +26,7 @@ class CallCache(object):
def call(self, fn, args=(), key=None):
if key is None:
key = (fn, tuple(args))
key = (fn, tuple(args))
#backport
#key = (fn, tuple(args)) if key is None else key
......@@ -43,4 +43,3 @@ class CallCache(object):
self.persist()
except Exception, e:
_logger.error('persist failed %s %s', self.filename, e)
......@@ -196,7 +196,7 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
if verbosity <= 1:
no_display = True
time.sleep(random.uniform(min_wait, max_wait))
try:
os.mkdir(tmp_dir)
except OSError:
......@@ -205,10 +205,10 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
continue
# Safety check: the directory should be here.
assert os.path.isdir(tmp_dir)
# Write own id into lock file.
unique_id = refresh_lock(lock_file)
# Verify we are really the lock owner (this should not be needed,
# but better be safe than sorry).
owner = open(lock_file).readlines()[0].strip()
......@@ -276,4 +276,3 @@ class Unlocker(object):
self.os.rmdir(self.tmp_dir)
except:
pass
......@@ -114,7 +114,7 @@ except Exception, e:
set_cuda_disabled()
if cuda_available:
# If necessary,
# If necessary,
# create a symlink called libcuda_ndarray.so
# which nvcc_module_compile_str uses when linking
# any module except "cuda_ndarray" itself.
......@@ -186,7 +186,7 @@ def use(device,
"nvcc was not found. Set it in your PATH "
"environment variable or set the Theano "
"flags 'cuda.root' to its directory" % device)
else:
else:
raise EnvironmentError("You forced the use of gpu device %s, "
"but CUDA initialization failed "
"with error:\n%s" % (
......
......@@ -667,7 +667,7 @@ nd_collapse_[i]=0;
l=["local_str[%(ipos)s][nd_collapse-1]==1 "%locals()for ipos in range(len(node.inputs)) if not _logical_scalar(node.inputs[ipos])]
l+=["local_ostr[%(ipos)s][nd_collapse-1]==1 "%locals()for ipos in range(len(node.outputs)) if not _logical_scalar(node.outputs[ipos])]
if len(l)>0:
print >> sio," && "," && ".join(l)
print >> sio," && "," && ".join(l)
print >> sio,"""){nd_collapse=0;} """
if self.verbose:
......@@ -956,4 +956,3 @@ nd_collapse_[i]=0;
#define INTDIV_POW2(a, b) (a >> b)
#define INTMOD_POW2(a, b) (a & ((1<<b)-1))
"""
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论