Exemplo n.º 1
0
 def testIsKronKron(self):
     # Tests _is_kron on a Kronecker matrix
     initializer = initializers.random_matrix(((2, 3), (3, 2)),
                                              tt_rank=1,
                                              dtype=self.dtype)
     kron_mat = variables.get_variable('kron_mat', initializer=initializer)
     self.assertTrue(kr._is_kron(kron_mat))
Exemplo n.º 2
0
 def testIsKronNonKron(self):
     # Tests _is_kron on a non-Kronecker matrix
     initializer = initializers.random_matrix(((2, 3), (3, 2)),
                                              tt_rank=2,
                                              dtype=self.dtype)
     tt_mat = variables.get_variable('tt_mat', initializer=initializer)
     self.assertFalse(kr._is_kron(tt_mat))
Exemplo n.º 3
0
 def testIsKronKron(self):
     # Tests _is_kron on a Kronecker matrix batch
     initializer = initializers.random_matrix_batch(((2, 3), (3, 2)),
                                                    tt_rank=1,
                                                    batch_size=3)
     kron_mat_batch = variables.get_variable('kron_mat_batch',
                                             initializer=initializer)
     self.assertTrue(kr._is_kron(kron_mat_batch))
Exemplo n.º 4
0
 def testIsKronNonKron(self):
     # Tests _is_kron on a non-Kronecker matrix batch
     initializer = initializers.random_matrix_batch(((2, 3), (3, 2)),
                                                    tt_rank=2,
                                                    batch_size=3)
     tt_mat_batch = variables.get_variable('tt_mat_batch',
                                           initializer=initializer)
     self.assertFalse(kr._is_kron(tt_mat_batch))