From fad74785d12ea7463e5d0474522cd7d754699656 Mon Sep 17 00:00:00 2001 From: Francois Chollet Date: Tue, 10 Apr 2018 18:41:37 -0700 Subject: [PATCH] Fix for users who were passing `Dimension` type as `units` arg in `Dense`. PiperOrigin-RevId: 192387984 --- tensorflow/python/keras/_impl/keras/layers/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/keras/_impl/keras/layers/core.py b/tensorflow/python/keras/_impl/keras/layers/core.py index 87b9972..f64174a 100644 --- a/tensorflow/python/keras/_impl/keras/layers/core.py +++ b/tensorflow/python/keras/_impl/keras/layers/core.py @@ -836,7 +836,7 @@ class Dense(Layer): super(Dense, self).__init__( activity_regularizer=regularizers.get(activity_regularizer), **kwargs) - self.units = units + self.units = int(units) self.activation = activations.get(activation) self.use_bias = use_bias self.kernel_initializer = initializers.get(kernel_initializer) -- 2.7.4