提交 76b71018 authored 作者: AdeB's avatar AdeB 提交者: Xavier Bouthillier

Flake8 and inplace removed from sparse_block_dot.

上级 a759089a
...@@ -229,7 +229,7 @@ cpu_sparse_block_outer = CpuSparseBlockOuter(False) ...@@ -229,7 +229,7 @@ cpu_sparse_block_outer = CpuSparseBlockOuter(False)
cpu_sparse_block_outer_inplace = CpuSparseBlockOuter(True) cpu_sparse_block_outer_inplace = CpuSparseBlockOuter(True)
def sparse_block_dot(W, h, inputIdx, b, outputIdx, inplace=False): def sparse_block_dot(W, h, inputIdx, b, outputIdx):
""" """
Compute the dot product (plus bias) of the specified pieces of vectors Compute the dot product (plus bias) of the specified pieces of vectors
and matrices. See SparseBlockGemv to get more information. and matrices. See SparseBlockGemv to get more information.
...@@ -263,5 +263,5 @@ def sparse_block_dot(W, h, inputIdx, b, outputIdx, inplace=False): ...@@ -263,5 +263,5 @@ def sparse_block_dot(W, h, inputIdx, b, outputIdx, inplace=False):
h = h.dimshuffle('x', 0, 1) h = h.dimshuffle('x', 0, 1)
inputIdx = inputIdx.dimshuffle('x', 0) inputIdx = inputIdx.dimshuffle('x', 0)
outputIdx = outputIdx.dimshuffle('x', 0) outputIdx = outputIdx.dimshuffle('x', 0)
return SparseBlockGemv(inplace)(b.take(outputIdx, axis=0), W, h, return SparseBlockGemv()(b.take(outputIdx, axis=0), W, h,
inputIdx, outputIdx) inputIdx, outputIdx)
...@@ -147,7 +147,7 @@ class BlockSparse_Gemv_and_Outer(unittest.TestCase): ...@@ -147,7 +147,7 @@ class BlockSparse_Gemv_and_Outer(unittest.TestCase):
for b in range(x.shape[0]): for b in range(x.shape[0]):
for i in range(xIdx.shape[1]): for i in range(xIdx.shape[1]):
for j in range(yIdx.shape[1]): for j in range(yIdx.shape[1]):
o[xIdx[b, i], yIdx[b, j]] += numpy.outer(x[b, i, :], o[xIdx[b, i], yIdx[b, j]] += numpy.outer(x[b, i, :],
y[b, j, :]) y[b, j, :])
return o return o
......
...@@ -98,18 +98,19 @@ whitelist_flake8 = [ ...@@ -98,18 +98,19 @@ whitelist_flake8 = [
"tensor/nnet/tests/test_sigm.py", "tensor/nnet/tests/test_sigm.py",
"scalar/__init__.py", "scalar/__init__.py",
"scalar/tests/test_basic.py", "scalar/tests/test_basic.py",
"sandbox/tests/test_theano_object.py", "sandbox/__init__.py",
"sandbox/tests/test_scan.py",
"sandbox/tests/test_rng_mrg.py",
"sandbox/tests/test_neighbourhoods.py",
"sandbox/tests/test_multinomial.py",
"sandbox/tests/__init__.py"
"sandbox/rng_mrg.py", "sandbox/rng_mrg.py",
"sandbox/theano_object.py", "sandbox/theano_object.py",
"sandbox/scan.py", "sandbox/scan.py",
"sandbox/symbolic_module.py", "sandbox/symbolic_module.py",
"sandbox/conv.py", "sandbox/conv.py",
"sandbox/debug.py", "sandbox/debug.py",
"sandbox/tests/test_theano_object.py",
"sandbox/tests/test_scan.py",
"sandbox/tests/test_rng_mrg.py",
"sandbox/tests/test_neighbourhoods.py",
"sandbox/tests/test_multinomial.py",
"sandbox/tests/__init__.py",
"sandbox/cuda/dnn.py", "sandbox/cuda/dnn.py",
"sandbox/cuda/var.py", "sandbox/cuda/var.py",
"sandbox/cuda/GpuConvGrad3D.py", "sandbox/cuda/GpuConvGrad3D.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论