提交 b57f6c25 authored 作者: Josh Bleecher Snyder's avatar Josh Bleecher Snyder

Change ambiguous tabs (caught by tabnanny) to spaces.

上级 979a35e7
...@@ -107,8 +107,8 @@ def search_entries(module_list, ops = None, constructors = None, seen = None): ...@@ -107,8 +107,8 @@ def search_entries(module_list, ops = None, constructors = None, seen = None):
for module in module_list: for module in module_list:
symbol_name_list = [s for s in dir(module) if not s[0] == '_'] symbol_name_list = [s for s in dir(module) if not s[0] == '_']
for symbol_name in symbol_name_list: for symbol_name in symbol_name_list:
symbol = getattr(module, symbol_name) symbol = getattr(module, symbol_name)
try: try:
if symbol in seen: if symbol in seen:
continue continue
......
...@@ -44,7 +44,7 @@ def test_add(): ...@@ -44,7 +44,7 @@ def test_add():
print shape, 'adding ', a0.size, 'cpu', cpu_dt, 'advantage', cpu_dt / gpu_dt print shape, 'adding ', a0.size, 'cpu', cpu_dt, 'advantage', cpu_dt / gpu_dt
assert numpy.allclose(asum, numpy.asarray(bsum)) assert numpy.allclose(asum, numpy.asarray(bsum))
if len(shape)>0: if len(shape)>0:
#test inplace version, not implemented with 0 dims #test inplace version, not implemented with 0 dims
b0 += b1 b0 += b1
a0 += a1 a0 += a1
...@@ -299,20 +299,20 @@ def test_mapping_getitem_w_int(): ...@@ -299,20 +299,20 @@ def test_mapping_getitem_w_int():
def _cmpf(x,*y): def _cmpf(x,*y):
try: try:
x.__getitem__(y) x.__getitem__(y)
except IndexError: except IndexError:
pass pass
else: else:
raise Exception("Did not generate out or bound error") raise Exception("Did not generate out or bound error")
def _cmpfV(x,*y): def _cmpfV(x,*y):
try: try:
if len(y)==1: if len(y)==1:
x.__getitem__(*y) x.__getitem__(*y)
else: else:
x.__getitem__(y) x.__getitem__(y)
except ValueError: except ValueError:
pass pass
else: else:
raise Exception("Did not generate out or bound error") raise Exception("Did not generate out or bound error")
dim =(2,) dim =(2,)
...@@ -421,7 +421,7 @@ def test_setitem_matrixvector1(): ...@@ -421,7 +421,7 @@ def test_setitem_matrixvector1():
try: try:
_a[:,1] = b*100 _a[:,1] = b*100
a[:,1] = b*100 a[:,1] = b*100
raise Exception("CudaNdarray.__setitem__ should have returned an error") raise Exception("CudaNdarray.__setitem__ should have returned an error")
assert numpy.allclose(a,numpy.asarray(_a)) assert numpy.allclose(a,numpy.asarray(_a))
except NotImplementedError, e: except NotImplementedError, e:
pass pass
...@@ -450,7 +450,7 @@ def test_setitem_matrix_tensor3(): ...@@ -450,7 +450,7 @@ def test_setitem_matrix_tensor3():
try: try:
_a[:,1,1] = b*100 _a[:,1,1] = b*100
a[:,1,1] = b*100 a[:,1,1] = b*100
raise Exception("CudaNdarray.__setitem__ should have returned an error") raise Exception("CudaNdarray.__setitem__ should have returned an error")
assert numpy.allclose(a,numpy.asarray(_a)) assert numpy.allclose(a,numpy.asarray(_a))
except NotImplementedError: except NotImplementedError:
pass pass
...@@ -605,7 +605,7 @@ def test_setitem_broadcast_numpy(): ...@@ -605,7 +605,7 @@ def test_setitem_broadcast_numpy():
try: try:
_a[:] = b.reshape((1,)) _a[:] = b.reshape((1,))
a[:] = b.reshape((1,)) a[:] = b.reshape((1,))
assert False assert False
assert numpy.allclose(numpy.asarray(_a),a) assert numpy.allclose(numpy.asarray(_a),a)
except ValueError: except ValueError:
pass pass
...@@ -619,10 +619,10 @@ def test_setitem_broadcast_numpy(): ...@@ -619,10 +619,10 @@ def test_setitem_broadcast_numpy():
b = theano._asarray([7,8,9], dtype='float32') b = theano._asarray([7,8,9], dtype='float32')
_a[:,:] = b.reshape((1,3)) _a[:,:] = b.reshape((1,3))
a[:,:] = b.reshape((1,3)) a[:,:] = b.reshape((1,3))
assert False assert False
assert numpy.allclose(numpy.asarray(_a),a) assert numpy.allclose(numpy.asarray(_a),a)
except ValueError: except ValueError:
pass pass
#test vector to matrice with stride #test vector to matrice with stride
a = numpy.arange(27) a = numpy.arange(27)
...@@ -635,10 +635,10 @@ def test_setitem_broadcast_numpy(): ...@@ -635,10 +635,10 @@ def test_setitem_broadcast_numpy():
b = b[0] b = b[0]
_a[1,:,:] = b.reshape((1,3)) _a[1,:,:] = b.reshape((1,3))
a[1,:,:] = b.reshape((1,3)) a[1,:,:] = b.reshape((1,3))
assert False assert False
assert numpy.allclose(numpy.asarray(_a),a) assert numpy.allclose(numpy.asarray(_a),a)
except ValueError: except ValueError:
pass pass
# this also fails for the moment # this also fails for the moment
def test_setitem_rightvalue_ndarray_fails(): def test_setitem_rightvalue_ndarray_fails():
......
...@@ -77,7 +77,7 @@ class multiple_outputs_numeric_grad: ...@@ -77,7 +77,7 @@ class multiple_outputs_numeric_grad:
for i in xrange(len(pt)): for i in xrange(len(pt)):
if ndarray_mask[i]: if ndarray_mask[i]:
# It is a ndarray that we can tweak # It is a ndarray that we can tweak
if eps: if eps:
_eps = eps _eps = eps
else: else:
_eps = dtype_eps _eps = dtype_eps
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论