| 23 | namespace { |
| 24 | |
| 25 | int InspectCheckpoint(const string& in) { |
| 26 | tensorflow::checkpoint::TensorSliceReader reader( |
| 27 | in, tensorflow::checkpoint::OpenTableTensorSliceReader); |
| 28 | Status s = reader.status(); |
| 29 | if (!s.ok()) { |
| 30 | fprintf(stderr, "Unable to open the checkpoint file\n"); |
| 31 | return -1; |
| 32 | } |
| 33 | for (auto e : reader.Tensors()) { |
| 34 | fprintf(stdout, "%s %s\n", e.first.c_str(), |
| 35 | e.second->shape().DebugString().c_str()); |
| 36 | } |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | } // namespace |
| 41 | } // namespace tensorflow |