Format code in pep8 standard
@@ -6,7 +6,8 @@ from tensorflow import keras
from .model import Model, NoSuchLayerError
-# Assignment rather than import because direct import from within Keras doesn't work in tf 1.8
+# Assignment rather than import because direct import from within Keras
+# doesn't work in tf 1.8
Sequential = keras.models.Sequential
Conv2D = keras.layers.Conv2D
Dense = keras.layers.Dense
@@ -14,6 +15,7 @@ Activation = keras.layers.Activation
Flatten = keras.layers.Flatten
KerasModel = keras.models.Model
+
def conv_2d(filters, kernel_shape, strides, padding, input_shape=None):
"""
Defines the right convolutional layer according to the
@@ -207,11 +209,13 @@ class KerasModelWrapper(Model):
# Make a new model that returns each of the layers as output
abstract_layers = self._get_abstract_layer_name()
if abstract_layers:
- warnings.warn("Abstract layer detected, picking last ouput node as default."
+ warnings.warn(
+ "Abstract layer detected, picking last ouput node as default."
"This could happen due to using of stacked model.")
layer_outputs = []
- # For those abstract model layers, return their last output node as default.
+ # For those abstract model layers, return their last output node as
+ # default.
for x_layer in self.model.layers:
if x_layer.name not in abstract_layers:
layer_outputs.append(x_layer.output)
