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

Function CheckUnitary

tensorflow/python/kernel_tests/qr_op_test.py:115–124  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

113 self.assertAllClose(a_recon, a, rtol=tol, atol=tol)
114
115 def CheckUnitary(self, x):
116 # Tests that x[...,:,:]^H * x[...,:,:] is close to the identity.
117 with ops.device("/cpu:0"):
118 xx = math_ops.matmul(x, x, adjoint_a=True)
119 identity = array_ops.matrix_band_part(array_ops.ones_like(xx), 0, 0)
120 if is_single:
121 tol = 1e-5
122 else:
123 tol = 1e-14
124 self.assertAllClose(identity, xx, atol=tol)
125
126 @test_util.run_v1_only("b/120545219")
127 def Test(self):

Callers 1

TestFunction · 0.70

Calls 3

deviceMethod · 0.45
matmulMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected