What is the difference between tf.keras.layers versus tf.layers?
E.g. both of them have Conv2d, do they provide different outputs?
Is there any benefits if you mix
Since TensorFlow 1.12, tf.layers
are merely wrappers around tf.keras.layers
.
A few examples:
Convolutional tf.layers
just inherit from the convolutional tf.keras.layers
, see source code here:
@tf_export('layers.Conv2D')
class Conv2D(keras_layers.Conv2D, base.Layer):
The same is true for all core tf.layers, e.g.:
@tf_export('layers.Dense')
class Dense(keras_layers.Dense, base.Layer):
With the integration of Keras into TensorFlow, it would make little sense to maintain several different layer implementations. tf.keras
is becoming the de-facto high-level API for TensorFlow, therefore tf.layers
are now just wrappers around tf.keras.layers
.