| 84 | } |
| 85 | |
| 86 | string DebugString(const Tensor& x, const Tensor& y) { |
| 87 | CHECK_EQ(x.NumElements(), 2); |
| 88 | CHECK_EQ(y.NumElements(), 2); |
| 89 | auto x_flat = x.flat<float>(); |
| 90 | auto y_flat = y.flat<float>(); |
| 91 | // Compute an estimate of the eigenvalue via |
| 92 | // (x' A x) / (x' x) = (x' y) / (x' x) |
| 93 | // and exploit the fact that x' x = 1 by assumption |
| 94 | Eigen::Tensor<float, 0, Eigen::RowMajor> lambda = (x_flat * y_flat).sum(); |
| 95 | return strings::Printf("lambda = %8.6f x = [%8.6f %8.6f] y = [%8.6f %8.6f]", |
| 96 | lambda(), x_flat(0), x_flat(1), y_flat(0), y_flat(1)); |
| 97 | } |
| 98 | |
| 99 | void ConcurrentSteps(const Options* opts, int session_index) { |
| 100 | // Creates a session. |
no test coverage detected