Skip to content

Commit 23cb9a0

Browse files
epurdykpe
authored andcommitted
Fix for string features (tensorflow#1440)
1 parent 39652cd commit 23cb9a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensor2tensor/utils/t2t_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ def summarize_features(features, num_shards=1):
20172017

20182018
with tf.name_scope("input_stats"):
20192019
for (k, v) in sorted(six.iteritems(features)):
2020-
if isinstance(v, tf.Tensor) and v.get_shape().ndims > 1:
2020+
if isinstance(v, tf.Tensor) and v.get_shape().ndims > 1 and v.dtype != tf.string:
20212021
tf.summary.scalar("%s_batch" % k, tf.shape(v)[0] // num_shards)
20222022
tf.summary.scalar("%s_length" % k, tf.shape(v)[1])
20232023
nonpadding = tf.to_float(tf.not_equal(v, 0))

0 commit comments

Comments
 (0)