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

Function CheckApproximation

tensorflow/python/kernel_tests/qr_op_test.py:105–113  ·  view source on GitHub ↗
(self, a, q, r)

Source from the content-addressed store, hash-verified

103 self.assertAllClose(x, y, atol=atol)
104
105 def CheckApproximation(self, a, q, r):
106 if is_single:
107 tol = 1e-5
108 else:
109 tol = 1e-14
110 # Tests that a ~= q*r.
111 with ops.device("/cpu:0"):
112 a_recon = math_ops.matmul(q, r)
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.

Callers 1

TestFunction · 0.70

Calls 3

deviceMethod · 0.45
matmulMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected