def _test(self, xp):
// A must be symmetric and positive-definite
random_mat = xp.random.normal(size=(self.n, self.n))
A = random_mat.dot(random_mat.T)
inv_A = inv_mat(A)
b = xp.random.normal(size=(self.n,))
After Change
def _test(self, xp):
// A must be symmetric and positive-definite
random_mat = xp.random.normal(size=(self.n, self.n)).astype(self.dtype)
A = random_mat.dot(random_mat.T)
inv_A = inv_mat(A)
b = xp.random.normal(size=(self.n,)).astype(self.dtype)
def A_product_func(vec):
self.assertEqual(xp, chainer.cuda.get_array_module(vec))