update all tf.shape and tensor.shape to shape_list

This commit is contained in:
thomwolf
2019-11-28 15:51:43 +01:00
committed by Lysandre Debut
parent 1ab8dc44b3
commit adb5c79ff2
13 changed files with 48 additions and 54 deletions

View File

@@ -494,7 +494,7 @@ class TFSequenceSummary(tf.keras.layers.Layer):
def shape_list(x):
"""Deal with dynamic shape in tensorflow cleanly."""
static = x.shape.as_list()
dynamic = tf.shape(x)
dynamic = shape_list(x)
return [dynamic[i] if s is None else s for i, s in enumerate(static)]
def get_initializer(initializer_range=0.02):