Computes the norm of matrices in 'x', adjusted for dimension and type.
(self, x)
| 33 | class QrOpTest(xla_test.XLATestCase, parameterized.TestCase): |
| 34 | |
| 35 | def AdjustedNorm(self, x): |
| 36 | """Computes the norm of matrices in 'x', adjusted for dimension and type.""" |
| 37 | norm = np.linalg.norm(x, axis=(-2, -1)) |
| 38 | return norm / (max(x.shape[-2:]) * np.finfo(x.dtype).eps) |
| 39 | |
| 40 | def CompareOrthogonal(self, x, y, rank): |
| 41 | # We only compare the first 'rank' orthogonal vectors since the |
no test coverage detected