def METHOD_NAME(layer, **kwargs):
    layer_instance = layer(**kwargs)
    config = layer_instance.get_config()
    layer_instance_new = layer(**config)
    config_new = layer_instance_new.get_config()
    # Remove 'name' if we have advanced activations (needed for GeneralConv)
    if (
        "activation" in config
        and isinstance(config["activation"], dict)
        and "class_name" in config["activation"]
    ):
        config["activation"]["config"].pop("name")
        config_new["activation"]["config"].pop("name")
    assert config_new == config