helion.kernel#
- helion.kernel(fn=None, *, config=None, configs=None, key=None, **settings)[source]#
Decorator to create a Kernel object from a Python function.
- Parameters:
fn (
Optional[Callable[...,TypeVar(_R)]]) – The function to be wrapped by the Kernel. If None, a decorator is returned.config (
Config|dict[str,object] |None) – A single configuration to use for the kernel. Refer to thehelion.Configclass for details.configs (
list[Config|dict[str,object]] |None) – A list of configurations to use for the kernel. Can only specify one of config or configs. Refer to thehelion.Configclass for details.key (
Optional[Callable[...,Hashable]]) – Optional callable returning a hashable that augments the specialization key.settings (
object) – Keyword arguments representing settings for the Kernel. Can also use settings=Settings(…) to pass a Settings object directly. Refer to thehelion.Settingsclass for available options.
- Returns:
A Kernel object or a decorator that returns a Kernel object.
- Return type: