Skip to content

Commit

Permalink
Remove temporary monitoring now that underlying perf issue is resolved
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 398533606
  • Loading branch information
Tomer Kaftan authored and tensorflower-gardener committed Sep 23, 2021
1 parent 8aecb5f commit 89fd0f5
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions keras/layers/core/dropout.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
import tensorflow.compat.v2 as tf
from tensorflow.python.util.tf_export import keras_export

# TODO(b/168039935): track dropout rate to decide whether/how to make a
# dropout rate fastpath.
keras_temporary_dropout_rate = tf.__internal__.monitoring.BoolGauge(
'/tensorflow/api/keras/dropout/temp_rate_is_zero',
'Temporarily record if Keras dropout layer was created w/'
'constant rate = 0')


@keras_export('keras.layers.Dropout')
class Dropout(Layer):
Expand Down Expand Up @@ -87,10 +80,6 @@ def __init__(self, rate, noise_shape=None, seed=None, **kwargs):
raise ValueError(f'Invalid value {rate} received for '
f'`rate`, expected a value between 0 and 1.')
self.rate = rate
if isinstance(rate, (int, float)) and not rate:
keras_temporary_dropout_rate.get_cell().set(True)
else:
keras_temporary_dropout_rate.get_cell().set(False)
self.noise_shape = noise_shape
self.seed = seed
self.supports_masking = True
Expand Down

0 comments on commit 89fd0f5

Please sign in to comment.