提交 9d1c754a authored 作者: Frederic Bastien's avatar Frederic Bastien

syntax change to respect pep8.

上级 1d6ab9dc
...@@ -660,9 +660,8 @@ def test_dot_w_self(): ...@@ -660,9 +660,8 @@ def test_dot_w_self():
def test_dot_vm(): def test_dot_vm():
''' Test vector dot matrix ''' ''' Test vector dot matrix '''
v = theano.shared( numpy.array(numpy.random.rand(2), dtype='float32')) v = theano.shared(numpy.array(numpy.random.rand(2), dtype='float32'))
m = theano.shared( numpy.array(numpy.random.rand(2,2), m = theano.shared(numpy.array(numpy.random.rand(2,2), dtype='float32'))
dtype='float32'))
f = theano.function([], theano.dot(v,m), mode = mode_blas_opt) f = theano.function([], theano.dot(v,m), mode = mode_blas_opt)
# Assert they produce the same output # Assert they produce the same output
...@@ -673,8 +672,8 @@ def test_dot_vm(): ...@@ -673,8 +672,8 @@ def test_dot_vm():
def test_dot_mv(): def test_dot_mv():
''' Test matrix dot vector ''' ''' Test matrix dot vector '''
v = theano.shared( numpy.array(numpy.random.rand(2), dtype='float32')) v = theano.shared(numpy.array(numpy.random.rand(2), dtype='float32'))
m = theano.shared( numpy.array(numpy.random.rand(2,2), m = theano.shared(numpy.array(numpy.random.rand(2,2),
dtype='float32')) dtype='float32'))
f = theano.function([], theano.dot(m,v), mode = mode_blas_opt) f = theano.function([], theano.dot(m,v), mode = mode_blas_opt)
...@@ -686,10 +685,10 @@ def test_dot_mv(): ...@@ -686,10 +685,10 @@ def test_dot_mv():
def test_gemv1(): def test_gemv1():
''' test vector1+dot(matrix,vector2) ''' ''' test vector1+dot(matrix,vector2) '''
v1 = theano.shared( numpy.array(numpy.random.rand(2) , dtype='float32')) v1 = theano.shared(numpy.array(numpy.random.rand(2), dtype='float32'))
v2_orig = numpy.array(numpy.random.rand(2), dtype='float32') v2_orig = numpy.array(numpy.random.rand(2), dtype='float32')
v2 = theano.shared( v2_orig ) v2 = theano.shared(v2_orig)
m = theano.shared( numpy.array(numpy.random.rand(2,2), dtype='float32')) m = theano.shared(numpy.array(numpy.random.rand(2,2), dtype='float32'))
f = theano.function([], v2+theano.dot(m,v1), mode = mode_blas_opt) f = theano.function([], v2+theano.dot(m,v1), mode = mode_blas_opt)
...@@ -716,10 +715,10 @@ def test_gemv1(): ...@@ -716,10 +715,10 @@ def test_gemv1():
def test_gemv2(): def test_gemv2():
''' test vector1+dot(vector2,matrix) ''' ''' test vector1+dot(vector2,matrix) '''
v1 = theano.shared( numpy.array(numpy.random.rand(2) , dtype='float32')) v1 = theano.shared(numpy.array(numpy.random.rand(2), dtype='float32'))
v2_orig = numpy.array(numpy.random.rand(2), dtype='float32') v2_orig = numpy.array(numpy.random.rand(2), dtype='float32')
v2 = theano.shared( v2_orig ) v2 = theano.shared(v2_orig )
m = theano.shared( numpy.array(numpy.random.rand(2,2), dtype='float32')) m = theano.shared(numpy.array(numpy.random.rand(2,2), dtype='float32'))
f = theano.function([], v2+theano.dot(v1,m), mode = mode_blas_opt) f = theano.function([], v2+theano.dot(v1,m), mode = mode_blas_opt)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论