Esempio n. 1
0
 def test_gpu_cholesky_inplace_opt(self):
     A = fmatrix("A")
     fn = aesara.function([A], GpuMagmaCholesky()(A), mode=mode_with_gpu)
     assert any([
         node.op.inplace for node in fn.maker.fgraph.toposort()
         if isinstance(node.op, GpuMagmaCholesky)
     ])
Esempio n. 2
0
 def run_gpu_cholesky(self, A_val, lower=True):
     A = aesara.tensor.fmatrix("A")
     f = aesara.function(
         [A],
         GpuMagmaCholesky(lower=lower)(A),
         mode=mode_with_gpu.excluding("cusolver"),
     )
     return f(A_val)
Esempio n. 3
0
 def test_gpu_cholesky_inplace(self):
     A = self.rand_symmetric(1000)
     A_gpu = gpuarray_shared_constructor(A)
     A_copy = A_gpu.get_value()
     C = GpuMagmaCholesky()(A_gpu)
     fn = aesara.function([], C, mode=mode_with_gpu, updates=[(A_gpu, C)])
     assert any([
         node.op.inplace for node in fn.maker.fgraph.toposort()
         if isinstance(node.op, GpuMagmaCholesky)
     ])
     fn()
     L = A_gpu.get_value()
     utt.assert_allclose(np.dot(L, L.T), A_copy, atol=1e-3)