提交 1aa6b381 authored 作者: Frederic Bastien's avatar Frederic Bastien

make code more clear and respect the 80 caracteres/line

上级 bcdfecc1
...@@ -148,7 +148,9 @@ def makeSharedTester(shared_constructor_, ...@@ -148,7 +148,9 @@ def makeSharedTester(shared_constructor_,
values_to_add = .5 values_to_add = .5
if self.add_matrix: if self.add_matrix:
values_to_add = self.internal_type(numpy.ones(x.shape,dtype=dtype)/2)#supported for cudandarray, but not ndarray. #supported for cudandarray, but not ndarray.
values_to_add = self.internal_type(
numpy.ones(x.shape,dtype=dtype)/2)
x /= values_to_add#supported by ndarray and CudaNdarray x /= values_to_add#supported by ndarray and CudaNdarray
#this is not required by the contract but it is a feature we can #this is not required by the contract but it is a feature we can
...@@ -407,9 +409,15 @@ def makeSharedTester(shared_constructor_, ...@@ -407,9 +409,15 @@ def makeSharedTester(shared_constructor_,
return SharedTester return SharedTester
test_shared_options=makeSharedTester(tensor.shared, 'float64', test_shared_options=makeSharedTester(
True, True, True, shared_constructor_ = tensor.shared,
numpy.ndarray, dtype_ = 'float64',
lambda a: isinstance(a,numpy.ndarray), get_value_borrow_true_alias_ = True,
theano.tensor.sum, shared_borrow_true_alias_ = True,
numpy.sum) set_value_borrow_true_alias_ = True,
internal_type_ = numpy.ndarray,
test_internal_type_ = lambda a: isinstance(a,numpy.ndarray),
theano_fct_ = theano.tensor.sum,
ref_fct_ = numpy.sum,
cast_value_ = numpy.asarray,
add_matrix_ = False)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论