def testMatmulSingleMatrix(self):
with self.test_session():
batch_shape = ()
for k in [1, 4]:
x_shape = batch_shape + (k, 5)
x = self._rng.rand(*x_shape)
chol_shape = batch_shape + (k, k)
chol = self._random_cholesky_array(chol_shape)
matrix = math_ops.matmul(chol, chol, adjoint_b=True)
operator = operator_pd_cholesky.OperatorPDCholesky(chol)
expected = math_ops.matmul(matrix, x)
self.assertEqual(expected.get_shape(), operator.matmul(x).get_shape())
self.assertAllClose(expected.eval(), operator.matmul(x).eval())
operator_pd_cholesky_test.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录