From 5e8a61d401e475755263120c203b4237fdd37781 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Tue, 30 May 2023 16:58:59 -0700 Subject: [PATCH] PR #17956: [keras/engine] Standardise docstring usage of "Default to" Imported from GitHub PR https://github.com/keras-team/keras/pull/17956 This is one of many PRs. Discussion + request to split into multiple PRs @ #17748 Copybara import of the project: -- 9ad7371a082a3df70c3b1e1e999cbb8d749d2417 by Samuel Marks <807580+SamuelMarks@users.noreply.github.com>: [keras/engine/base_layer.py,keras/engine/base_layer_utils.py,keras/engine/base_layer_v1.py,keras/engine/base_preprocessing_layer.py,keras/engine/data_adapter.py,keras/engine/functional.py,keras/engine/input_layer.py,keras/engine/training.py,keras/engine/training_v1.py] Standardise docstring usage of "Default to" Merging this change closes #17956 FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/keras-team/keras/pull/17956 from SamuelMarks:keras.engine-defaults-to 9ad7371a082a3df70c3b1e1e999cbb8d749d2417 PiperOrigin-RevId: 536547635 --- keras/engine/base_layer_v1.py | 2 +- keras/engine/base_preprocessing_layer.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keras/engine/base_layer_v1.py b/keras/engine/base_layer_v1.py index 8baae694454..abc72f3879f 100644 --- a/keras/engine/base_layer_v1.py +++ b/keras/engine/base_layer_v1.py @@ -237,7 +237,7 @@ def __init__( # Whether the layer will track any layers that are set as attribute on # itself as sub-layers, the weights from the sub-layers will be included - # in the parent layer's variables() as well. Default to True, which + # in the parent layer's variables() as well. Defaults to `True`, which # means auto tracking is turned on. Certain subclass might want to turn # it off, like the Sequential model. self._auto_track_sub_layers = True diff --git a/keras/engine/base_preprocessing_layer.py b/keras/engine/base_preprocessing_layer.py index 56e648ef525..bdd32405ee0 100644 --- a/keras/engine/base_preprocessing_layer.py +++ b/keras/engine/base_preprocessing_layer.py @@ -140,14 +140,14 @@ def compile(self, run_eagerly=None, steps_per_execution=None): """Configures the layer for `adapt`. Arguments: - run_eagerly: Bool. Defaults to `False`. If `True`, this `Model`'s + run_eagerly: Bool. If `True`, this `Model`'s logic will not be wrapped in a `tf.function`. Recommended to leave this as `None` unless your `Model` cannot be run inside a - `tf.function`. - steps_per_execution: Int. Defaults to 1. The number of batches to run + `tf.function`. Defaults to `False`. + steps_per_execution: Int. The number of batches to run during each `tf.function` call. Running multiple batches inside a single `tf.function` call can greatly improve performance on TPUs or - small models with a large Python overhead. + small models with a large Python overhead. Defaults to `1`. """ if steps_per_execution is None: steps_per_execution = 1