aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Zongheng Yang <zongheng@google.com>2016-09-08 16:58:29 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-09-08 18:04:00 -0700
commitfe927dc48401ff8528157fd3e6c57556cf3bee9d (patch)
tree05d0d5de851c63362e80498b5360a2e70659f833
parent10272d2bb7275a9e7c0b266928d8d9b3763d8f44 (diff)
inspect_checkpoint: make it print out number of slices.
This is useful debugging information to have. Example: > ./path/to/bin/inspect_checkpoint --file_name=/path/to/ckpt ... output_embedding/weight (DT_FLOAT) [1000000,512], 12 slices user-country-embedding/embedding (DT_FLOAT) [1000,64] ... Change: 132624087
-rw-r--r--tensorflow/core/util/tensor_slice_reader.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/tensorflow/core/util/tensor_slice_reader.cc b/tensorflow/core/util/tensor_slice_reader.cc
index b40f5e7736..5375206996 100644
--- a/tensorflow/core/util/tensor_slice_reader.cc
+++ b/tensorflow/core/util/tensor_slice_reader.cc
@@ -290,7 +290,13 @@ const string TensorSliceReader::DebugString() const {
for (auto e : Tensors()) {
strings::StrAppend(&shape_str, e.first, " (",
EnumName_DataType(e.second->type()), ") ",
- e.second->shape().DebugString(), "\n");
+ e.second->shape().DebugString());
+ // Indicates if a tensor has more than 1 slice (i.e., it's partitioned).
+ const int num_slices = e.second->Slices().size();
+ if (num_slices > 1) {
+ strings::StrAppend(&shape_str, ", ", num_slices, " slices");
+ }
+ strings::StrAppend(&shape_str, "\n");
}
}
return shape_str;