From 10a0142b48194329753abc65aead77914839fa88 Mon Sep 17 00:00:00 2001 From: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:16:04 +0100 Subject: [PATCH 1/6] docs: add params to Sequential.pop docstring in sequential.py --- keras/src/models/sequential.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 5815add1c142..4dc83bb8ea05 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -125,7 +125,12 @@ def add(self, layer, rebuild=True): self._functional = None def pop(self, rebuild=True): - """Removes the last layer in the model.""" + """Removes the last layer in the model. + Args: + rebuild: Boolean, whether to rebuild the model after removing the layer. + Returns: + layer: layer instance. + """ layer = self._layers.pop() self.built = False self._functional = None From 859da285db889b69718c131c9f1777d714b2fa18 Mon Sep 17 00:00:00 2001 From: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:36:53 +0100 Subject: [PATCH 2/6] Remove trailing white space in Sequential.pop docstring in sequential.py --- keras/src/models/sequential.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 4dc83bb8ea05..6e674892bfcc 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -126,7 +126,8 @@ def add(self, layer, rebuild=True): def pop(self, rebuild=True): """Removes the last layer in the model. - Args: + + Args: rebuild: Boolean, whether to rebuild the model after removing the layer. Returns: layer: layer instance. From 0a13199047018b50c314ede9a33a2f89184f878f Mon Sep 17 00:00:00 2001 From: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com> Date: Wed, 12 Feb 2025 23:13:19 +0100 Subject: [PATCH 3/6] Remove trailing white space in sequential.py --- keras/src/models/sequential.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 6e674892bfcc..14b9cabec82d 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -125,8 +125,7 @@ def add(self, layer, rebuild=True): self._functional = None def pop(self, rebuild=True): - """Removes the last layer in the model. - + """Removes the last layer in the model. Args: rebuild: Boolean, whether to rebuild the model after removing the layer. Returns: From ed4649b5519e00ed9d16e8512123765bbf057dc5 Mon Sep 17 00:00:00 2001 From: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com> Date: Thu, 13 Feb 2025 08:22:24 +0100 Subject: [PATCH 4/6] docs: add the default argument value in Sequential.pop docstring in sequential.py --- keras/src/models/sequential.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 14b9cabec82d..a4584552252c 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -127,7 +127,8 @@ def add(self, layer, rebuild=True): def pop(self, rebuild=True): """Removes the last layer in the model. Args: - rebuild: Boolean, whether to rebuild the model after removing the layer. + rebuild: Boolean. Whether to rebuild the model after removing + the layer. Defaults to True. Returns: layer: layer instance. """ From 1e88b646261d7d75070517d2aebd0622ef24723b Mon Sep 17 00:00:00 2001 From: Nikola Savic Date: Thu, 13 Feb 2025 08:50:35 +0100 Subject: [PATCH 5/6] sytle: reformat sequential.py with black --- keras/src/models/sequential.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index a4584552252c..2931edb9950a 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -125,7 +125,7 @@ def add(self, layer, rebuild=True): self._functional = None def pop(self, rebuild=True): - """Removes the last layer in the model. + """Removes the last layer in the model. Args: rebuild: Boolean. Whether to rebuild the model after removing the layer. Defaults to True. From 445ffd73c6beeac7a310651490b558efa4448a35 Mon Sep 17 00:00:00 2001 From: Nikola Savic Date: Fri, 14 Feb 2025 08:41:56 +0100 Subject: [PATCH 6/6] docs: fix Sequential.pop docstring formatting --- keras/src/models/sequential.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 2931edb9950a..a717990c067b 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -126,9 +126,11 @@ def add(self, layer, rebuild=True): def pop(self, rebuild=True): """Removes the last layer in the model. + Args: - rebuild: Boolean. Whether to rebuild the model after removing - the layer. Defaults to True. + rebuild: `bool`. Whether to rebuild the model after removing + the layer. Defaults to `True`. + Returns: layer: layer instance. """