def run_gpu_svd(self, A_val, full_matrices=True, compute_uv=True): A = aesara.tensor.fmatrix("A") f = aesara.function( [A], gpu_svd(A, full_matrices=full_matrices, compute_uv=compute_uv), mode=mode_with_gpu, ) return f(A_val)
def test_gpu_singular_values(self): A = aesara.tensor.fmatrix("A") f_cpu = aesara.function( [A], aesara.tensor.nlinalg.svd(A, compute_uv=False), mode=mode_without_gpu ) f_gpu = aesara.function([A], gpu_svd(A, compute_uv=False), mode=mode_with_gpu) A_val = rand(50, 100).astype("float32") utt.assert_allclose(f_cpu(A_val), f_gpu(A_val)) A_val = rand(100, 50).astype("float32") utt.assert_allclose(f_cpu(A_val), f_gpu(A_val))