def METHOD_NAME(cls):
    for fw in [fwk.strip() for fwk in framework.split(",")]:
        assert fw in ["tensorflow", "pytorch"], "The framework support tensorflow pytorch"
        if optimizer_type in registry_optimizers[fw].keys():
            raise ValueError("Cannot have two optimizers with the same name")
        registry_optimizers[fw][optimizer_type] = cls
    return cls