| 86 | static char hex_char[] = "0123456789abcdef"; |
| 87 | |
| 88 | string PrintMemory(const char* ptr, size_t n) { |
| 89 | string ret; |
| 90 | ret.resize(n * 3); |
| 91 | for (int i = 0; i < n; ++i) { |
| 92 | ret[i * 3] = ' '; |
| 93 | ret[i * 3 + 1] = hex_char[ptr[i] >> 4]; |
| 94 | ret[i * 3 + 2] = hex_char[ptr[i] & 0xf]; |
| 95 | } |
| 96 | return ret; |
| 97 | } |
| 98 | |
| 99 | string SliceDebugString(const TensorShape& shape, const int64 flat) { |
| 100 | // Special case rank 0 and 1 |
no test coverage detected