提交 61c1d5cd authored 作者: Frederic Bastien's avatar Frederic Bastien

better formatting following review.

上级 49091e90
......@@ -654,7 +654,6 @@ class Test_aliasing_rules(unittest.TestCase):
# rule #2 reading back from theano-managed memory
assert not numpy.may_share_memory(A.get_value(borrow=False), data_of(A))
def test_sparse_input_aliasing_affecting_inplace_operations(self):
##
## Note this test will never fail because I am not aware of any
......@@ -662,7 +661,8 @@ class Test_aliasing_rules(unittest.TestCase):
try:
import scipy.sparse as sp
except ImportError:
pass#the variable enable_sparse will be used to disable the test file.
# The variable enable_sparse will be used to disable the test file.
pass
from theano.sparse import enable_sparse
if enable_sparse == False:
......@@ -671,9 +671,9 @@ class Test_aliasing_rules(unittest.TestCase):
from theano import sparse
## Note: to trigger this bug with theano rev 4586:2bc6fc7f218b,
# you need to make in inputs mutable ( so that inplace
# you need to make in inputs mutable (so that inplace
# operations are used) and to break the elemwise composition
# with some non-elemwise op ( here dot )
# with some non-elemwise op (here dot)
x = sparse.SparseType('csc', dtype = 'float64')()
y = sparse.SparseType('csc', dtype = 'float64')()
......@@ -702,15 +702,12 @@ class Test_aliasing_rules(unittest.TestCase):
assert numpy.allclose(vals.todense(), bogus_vals.todense())
def test_input_aliasing_affecting_inplace_operations(self):
## Note: to trigger this bug with theano rev 4586:2bc6fc7f218b,
# you need to make in inputs mutable ( so that inplace
# you need to make in inputs mutable (so that inplace
# operations are used) and to break the elemwise composition
# with some non-elemwise op ( here dot )
# with some non-elemwise op (here dot)
x = theano.tensor.dvector()
y = theano.tensor.dvector()
m1 = theano.tensor.dmatrix()
......
......@@ -822,10 +822,16 @@ def test_shared_float32():
import theano.tensor.tests.test_sharedvar
test_shared_options = theano.tensor.tests.test_sharedvar.makeSharedTester(
tcn.shared_constructor, 'float32', False, False, False,
cuda_ndarray.CudaNdarray,
lambda a: isinstance(a,cuda_ndarray.CudaNdarray),
theano.tensor.exp, numpy.exp,
shared_constructor_ = tcn.shared_constructor,
dtype_ = 'float32',
get_value_borrow_true_alias_ = False,
shared_borrow_true_alias_ = False,
set_value_borrow_true_alias_ = False,
internal_type_ = cuda_ndarray.CudaNdarray,
test_internal_type_ = lambda a: isinstance(a,cuda_ndarray.CudaNdarray),
theano_fct_ = theano.tensor.exp,
ref_fct_ = numpy.exp,
cast_value_ = numpy.asarray,
add_matrix_ = True)
if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论