MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CheckUnitary

Method CheckUnitary

tensorflow/compiler/tests/qr_op_test.py:62–67  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

60 self.assertTrue(np.all(precision < 3200.0))
61
62 def CheckUnitary(self, x):
63 # Tests that x[...,:,:]^H * x[...,:,:] is close to the identity.
64 xx = math_ops.matmul(x, x, adjoint_a=True)
65 identity = array_ops.matrix_band_part(array_ops.ones_like(xx), 0, 0)
66 precision = self.AdjustedNorm(xx.eval() - self.evaluate(identity))
67 self.assertTrue(np.all(precision < 4800.0))
68
69 def _test(self, dtype, shape, full_matrices):
70 np.random.seed(1)

Callers 1

_testMethod · 0.95

Calls 5

AdjustedNormMethod · 0.95
matmulMethod · 0.45
evalMethod · 0.45
evaluateMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected