aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/layers/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/layers/core.py')
-rw-r--r--tensorflow/python/layers/core.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/tensorflow/python/layers/core.py b/tensorflow/python/layers/core.py
index ec4fca78f0..6970bf9234 100644
--- a/tensorflow/python/layers/core.py
+++ b/tensorflow/python/layers/core.py
@@ -36,6 +36,7 @@ from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn
+from tensorflow.python.ops import nn_ops
from tensorflow.python.ops import standard_ops
from tensorflow.python.util.tf_export import tf_export
@@ -291,13 +292,7 @@ class Dropout(base.Layer):
# shapes with dynamically sized inputs.
if self.noise_shape is None:
return self.noise_shape
-
- symbolic_shape = array_ops.shape(inputs)
- noise_shape = [
- symbolic_shape[axis] if shape is None else shape
- for axis, shape in enumerate(self.noise_shape)
- ]
- return noise_shape
+ return nn_ops._get_noise_shape(inputs, self.noise_shape)
def call(self, inputs, training=False):