提交 4c87b1b3 authored 作者: Thomas George's avatar Thomas George

addressed @notoraptor comments

上级 ace491ba
...@@ -8,9 +8,6 @@ from theano import Op ...@@ -8,9 +8,6 @@ from theano import Op
from theano.gpuarray import basic_ops, GpuArrayType from theano.gpuarray import basic_ops, GpuArrayType
from pygpu.gpuarray import GpuKernel, GpuArray
from string import Template
import numpy as np import numpy as np
from numpy.linalg.linalg import LinAlgError from numpy.linalg.linalg import LinAlgError
......
...@@ -1975,7 +1975,7 @@ def local_gpu_solve(op, context_name, inputs, outputs): ...@@ -1975,7 +1975,7 @@ def local_gpu_solve(op, context_name, inputs, outputs):
def local_gpu_cholesky(op, context_name, inputs, outputs): def local_gpu_cholesky(op, context_name, inputs, outputs):
if not cusolver_available: if not cusolver_available:
return return
return GpuCholesky() return GpuCholesky(lower=op.lower, inplace=op.destructive)
# Do not register in fast_run or fast_compile. # Do not register in fast_run or fast_compile.
# It will be added to fast_run if the GPU is enabled. # It will be added to fast_run if the GPU is enabled.
......
...@@ -191,4 +191,3 @@ class TestGpuCholesky(unittest.TestCase): ...@@ -191,4 +191,3 @@ class TestGpuCholesky(unittest.TestCase):
A_val = -M_val.dot(M_val.T) A_val = -M_val.dot(M_val.T)
fn = self.get_gpu_cholesky_func(True, False) fn = self.get_gpu_cholesky_func(True, False)
self.assertRaises(LinAlgError, fn, A_val) self.assertRaises(LinAlgError, fn, A_val)
...@@ -573,7 +573,7 @@ def test_local_lift_solve(): ...@@ -573,7 +573,7 @@ def test_local_lift_solve():
A = tensor.fmatrix() A = tensor.fmatrix()
b = tensor.fmatrix() b = tensor.fmatrix()
o = slinalg.solve(A, b) o = slinalg.solve(A, b)
f_cpu = theano.function([A, b], o) f_cpu = theano.function([A, b], o, mode_without_gpu)
f_gpu = theano.function([A, b], o, mode=mode_with_gpu) f_gpu = theano.function([A, b], o, mode=mode_with_gpu)
assert not any(isinstance(n.op, slinalg.Solve) assert not any(isinstance(n.op, slinalg.Solve)
for n in f_gpu.maker.fgraph.apply_nodes) for n in f_gpu.maker.fgraph.apply_nodes)
...@@ -589,7 +589,7 @@ def test_local_lift_cholesky(): ...@@ -589,7 +589,7 @@ def test_local_lift_cholesky():
raise SkipTest('No cuSolver') raise SkipTest('No cuSolver')
A = tensor.fmatrix() A = tensor.fmatrix()
o = slinalg.cholesky(A) o = slinalg.cholesky(A)
f_cpu = theano.function([A], o) f_cpu = theano.function([A], o, mode=mode_without_gpu)
f_gpu = theano.function([A], o, mode=mode_with_gpu) f_gpu = theano.function([A], o, mode=mode_with_gpu)
assert not any(isinstance(n.op, slinalg.Cholesky) assert not any(isinstance(n.op, slinalg.Cholesky)
for n in f_gpu.maker.fgraph.apply_nodes) for n in f_gpu.maker.fgraph.apply_nodes)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论