Skip to content

Commit ae84c08

Browse files
authored
fix lint (keras-team#168)
Co-authored-by: Haifeng Jin <[email protected]>
1 parent fc3ef02 commit ae84c08

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

keras_core/layers/layer.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ def stateless_call(
472472
473473
Args:
474474
trainable_variables: List of trainable variables of the model.
475-
non_trainable_variables: List of non-trainable variables of the model.
475+
non_trainable_variables: List of non-trainable variables of the
476+
model.
476477
*args: Positional argumets to be passed to `call()`.
477478
return_losses: If `True`, `stateless_call()` will return the list of
478479
losses created during `call()` as part of its return values.
@@ -504,7 +505,9 @@ def stateless_call(
504505
)
505506
# Attach the updated state to the model
506507
# (until you do this, the model is still in its pre-call state).
507-
for ref_var, value in zip(model.non_trainable_variables, non_trainable_variables):
508+
for ref_var, value in zip(
509+
model.non_trainable_variables, non_trainable_variables
510+
):
508511
ref_var.assign(value)
509512
```
510513
"""
@@ -597,7 +600,8 @@ def compute_output_spec(self, *args, **kwargs):
597600
and isinstance(output_shape[0], (int, type(None)))
598601
):
599602
return KerasTensor(output_shape, dtype=self.compute_dtype)
600-
# Case: nested. Could be a tuple/list of shapes, or a dict of shapes.
603+
# Case: nested. Could be a tuple/list of shapes, or a dict of
604+
# shapes.
601605
if isinstance(output_shape, list):
602606
return [
603607
KerasTensor(s, dtype=self.compute_dtype)
@@ -770,7 +774,8 @@ def _maybe_build(self, call_spec):
770774
"In a layer with multiple tensor arguments "
771775
"in call(), the build() method should accept "
772776
"corresponding `*_shape` arguments, e.g. "
773-
"if the call signature is `def call(self, x1, x2)` "
777+
"if the call signature is "
778+
"`def call(self, x1, x2)` "
774779
"then the build signature should be "
775780
"`def build(self, x1_shape, x2_shape)`. "
776781
"Keras will not build this layer automatically "

keras_core/trainers/epoch_iterator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def __init__(
115115
)
116116
if class_weight is not None:
117117
raise ValueError(
118-
"Argument `class_weight` is not supported for Python generator "
119-
f"inputs. Received: class_weight={class_weight}"
118+
"Argument `class_weight` is not supported for Python "
119+
f"generator inputs. Received: class_weight={class_weight}"
120120
)
121121
if shuffle:
122122
raise ValueError(

pip_build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def build():
4040

4141
whl_path = None
4242
try:
43-
# Copy sources (`keras_core/` directory and setup files) to build directory
43+
# Copy sources (`keras_core/` directory and setup files) to build
44+
# directory
4445
root_path = pathlib.Path(__file__).parent.resolve()
4546
os.chdir(root_path)
4647
os.mkdir(build_directory)

setup.cfg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,4 @@ per-file-ignores =
4848
# import not used
4949
**/__init__.py:F401
5050
**/random.py:F401
51-
# TODO: remove the following files when long lines are reformatted.
52-
keras_core/trainers/trainer.py:E501
53-
keras_core/trainers/epoch_iterator.py:E501
54-
keras_core/trainers/data_adapters/array_data_adapter.py:E501
55-
keras_core/trainers/compile_utils.py:E501
56-
keras_core/saving/object_registration.py:E501
57-
keras_core/regularizers/regularizers.py:E501
58-
keras_core/optimizers/optimizer.py:E501
59-
keras_core/operations/function.py:E501
60-
keras_core/models/sequential.py:E501
61-
keras_core/models/functional.py:E501
62-
keras_core/layers/layer.py:E501
63-
keras_core/initializers/random_initializers.py:E501
64-
keras_core/saving/saving_lib_test.py:E501
6551
max-line-length = 80

0 commit comments

Comments
 (0)