| 303 | } |
| 304 | |
| 305 | const string TensorSliceReader::DebugString() const { |
| 306 | string shape_str; |
| 307 | if (status().ok()) { |
| 308 | for (auto e : Tensors()) { |
| 309 | strings::StrAppend(&shape_str, e.first, " (", |
| 310 | EnumName_DataType(e.second->type()), ") ", |
| 311 | e.second->shape().DebugString()); |
| 312 | // Indicates if a tensor has more than 1 slice (i.e., it's partitioned). |
| 313 | const int num_slices = e.second->Slices().size(); |
| 314 | if (num_slices > 1) { |
| 315 | strings::StrAppend(&shape_str, ", ", num_slices, " slices"); |
| 316 | } |
| 317 | strings::StrAppend(&shape_str, "\n"); |
| 318 | } |
| 319 | } |
| 320 | return shape_str; |
| 321 | } |
| 322 | |
| 323 | } // namespace checkpoint |
| 324 | |