Skip to main content

clika_runtime.modelverse.models functions

resolve_device​

resolve_device(device: 'clika_runtime.Device | str | None') -> 'clika_runtime.Device | None'

A Device from a device or its string form; None passes through, and the string "auto" (case-folded) resolves to None as well: the automatic placement by name, the same pick loading without a device makes, with the same fallback when an accelerator refuses the load.

resolve_dtype​

resolve_dtype(dtype: 'clika_runtime.dtype | str | None') -> 'clika_runtime.dtype | None'

The dtype object for a dtype object (as is), its name or torch alias ("bfloat16", "half", "torch.float32"); None keeps the checkpoint's own dtype and passes through.