helion.kernel#
- helion.kernel(fn=None, *, config=None, configs=None, key=None, cute_structural_policy=_DefaultStructuralPolicy.OMITTED, **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] |CuteStructuralConfig|None) – A single configuration to use for the kernel. Refer to thehelion.Configclass for details.configs (
Sequence[Config|dict[str,object] |CuteStructuralConfig] |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.cute_structural_policy (
Union[CuteStructuralPolicy,Literal['auto'],None,_DefaultStructuralPolicy]) – Select the CuTe config schema before binding. Ordinary CuTe searches without recorded configs automatically enable proved structural passes while honoring explicit settings. None preserves legacy configs and cache identity; “auto” also permits selection for a no-search invocation. A recorded policy selects its exact schema. Existing unversioned declarations retain their axes.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: