def METHOD_NAME(base_layer, rnn):
    base_layer = base_layer()
    wn_layer = wrappers.WeightNormalization(base_layer, not rnn)
    new_wn_layer = tf.keras.layers.deserialize(tf.keras.layers.serialize(wn_layer))
    assert wn_layer.data_init == new_wn_layer.data_init
    assert wn_layer.is_rnn == new_wn_layer.is_rnn
    assert wn_layer.is_rnn == rnn
    if not isinstance(base_layer, tf.keras.layers.LSTM):
        # Issue with LSTM serialization, check with TF-core
        # Before serialization: tensorflow.python.keras.layers.recurrent_v2.LSTM
        # After serialization: tensorflow.python.keras.layers.recurrent.LSTM
        assert isinstance(new_wn_layer.layer, base_layer.__class__)