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

Function DebugString

tensorflow/cc/tutorials/example_trainer.cc:86–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86string 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
99void ConcurrentSteps(const Options* opts, int session_index) {
100 // Creates a session.

Callers 1

ConcurrentStepsFunction · 0.70

Calls 3

PrintfFunction · 0.85
NumElementsMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected