From 8398b862ffc988165c63ed5c76fdeae9635d3640 Mon Sep 17 00:00:00 2001 From: Pavithra Vijay Date: Tue, 9 Jun 2020 00:19:53 -0700 Subject: [PATCH] Mark layer `updates` property as deprecated as updates get applied automatically in TF2. PiperOrigin-RevId: 315433255 Change-Id: I690ec4b15f3dea228a7d26e0bd5332617c0525a2 --- tensorflow/python/keras/engine/base_layer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tensorflow/python/keras/engine/base_layer.py b/tensorflow/python/keras/engine/base_layer.py index 561355f5f57..87f306b2879 100644 --- a/tensorflow/python/keras/engine/base_layer.py +++ b/tensorflow/python/keras/engine/base_layer.py @@ -1327,10 +1327,13 @@ class Layer(module.Module, version_utils.LayerVersionSelector): return self.trainable_weights + self.non_trainable_weights @property - @doc_controls.do_not_doc_inheritable + @deprecation.deprecated( + date=None, + instructions='This property should not be used in TensorFlow 2.0, ' + 'as updates are applied automatically.') + @doc_controls.do_not_generate_docs def updates(self): - if (keras_tensor.keras_tensors_enabled() - and ops.executing_eagerly_outside_functions()): + if keras_tensor.keras_tensors_enabled(): return [] collected_updates = []