提交 2f768355 authored 作者: Alexander Matyasko's avatar Alexander Matyasko

Remove inplace for gpu_matrix_inverse interface

上级 23527587
...@@ -493,18 +493,13 @@ class GpuMagmaMatrixInverse(COp): ...@@ -493,18 +493,13 @@ class GpuMagmaMatrixInverse(COp):
return shapes return shapes
def gpu_matrix_inverse(a, inplace=False): def gpu_matrix_inverse(a):
""" """
This function performs the matrix inverse on GPU. This function performs the matrix inverse on GPU.
Parameters
----------
inplace : bool, optional
Whether or not to compute matrix inverse inplace.
Returns Returns
------- -------
a_inv: matrix a_inv: matrix
""" """
return GpuMagmaMatrixInverse(inplace=inplace)(a) return GpuMagmaMatrixInverse()(a)
...@@ -220,7 +220,7 @@ class TestMagma(unittest.TestCase): ...@@ -220,7 +220,7 @@ class TestMagma(unittest.TestCase):
N = 1000 N = 1000
A_val_gpu = gpuarray_shared_constructor(rand(N, N)) A_val_gpu = gpuarray_shared_constructor(rand(N, N))
A_val_copy = A_val_gpu.get_value() A_val_copy = A_val_gpu.get_value()
fn = theano.function([], gpu_matrix_inverse(A_val_gpu, inplace=True), fn = theano.function([], GpuMagmaMatrixInverse(inplace=True)(A_val_gpu),
mode=mode_with_gpu, accept_inplace=True) mode=mode_with_gpu, accept_inplace=True)
fn() fn()
utt.assert_allclose(np.dot(A_val_gpu.get_value(), A_val_copy), np.eye(N), atol=1e-3) utt.assert_allclose(np.dot(A_val_gpu.get_value(), A_val_copy), np.eye(N), atol=1e-3)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论