in optimum/exporters/executorch/recipe_registry.py [0:0]
def register_recipe(recipe_name):
"""
Decorator to register a recipe for exporting and lowering an ExecuTorch model under a specific name.
Args:
recipe_name (`str`):
The name of the recipe to associate with a callable recipe.
Returns:
`Callable`:
The original function wrapped as a registered recipe.
Example:
```python
@register_recipe("my_new_recipe")
def my_new_recipe(...):
...
```
"""
def decorator(func):
recipe_registry[recipe_name] = func
return func
return decorator