Forward ones not zeros when creating variables
@@ -245,9 +245,9 @@ class Model(tf.keras.layers.Layer):
# batch dimension as sometimes assumed by make_features methods and set
# unspecified dimensions to 1.
features = tf.nest.map_structure(
- lambda spec: tf.zeros(
+ lambda spec: tf.fill(
[dim or 1 for dim in spec.shape.as_list()[1:]],
- dtype=spec.dtype),
+ tf.constant("" if spec.dtype is tf.string else 1, dtype=spec.dtype)),
self.examples_inputter.input_signature())
features = self.examples_inputter.make_features(features=features)
