diff --git a/deepctr/layers/activation.py b/deepctr/layers/activation.py index 5e55945f..e5b77938 100644 --- a/deepctr/layers/activation.py +++ b/deepctr/layers/activation.py @@ -70,6 +70,8 @@ def activation_layer(activation): act_layer = tf.keras.layers.Activation(activation) elif issubclass(activation, Layer): act_layer = activation() + elif isinstance(activation, Layer): + act_layer = activation else: raise ValueError( "Invalid activation,found %s.You should use a str or a Activation Layer Class." % (activation))