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

Method testSVD

tensorflow/compiler/xla/python/xla_client_test.py:1416–1423  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1414 # self.assertLess(np.linalg.norm(np.dot(a, v) - w * v), 1e-3)
1415
1416 def testSVD(self):
1417 a = np.array(
1418 [[4, 6, 8, 10], [6, 45, 54, 63], [8, 54, 146, 166], [10, 63, 166, 310]],
1419 dtype=np.float32)
1420 c = self._NewComputation()
1421 c.SVD(c.Constant(a))
1422 u, d, v = self._Execute(c, ())
1423 self.assertLess(np.linalg.norm(a - np.matmul(u * d, v.T)), 1e-3)
1424
1425 def testTriangularSolve(self):
1426 a_vals = np.array(

Callers

nothing calls this directly

Calls 5

_NewComputationMethod · 0.80
SVDMethod · 0.80
ConstantMethod · 0.45
_ExecuteMethod · 0.45
matmulMethod · 0.45

Tested by

no test coverage detected