Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

device_resolve

Torch device selection for Moirai-MoE (no uni2ts import — safe for lightweight unit tests).

resolve_moirai_moe_torch_device(device_setting)

Map settings.yaml device string to a torch.device.

  • auto / cuda_if_available: CUDA when torch.cuda.is_available else CPU.
  • cuda: CUDA only; raises if CUDA is not available.
  • cuda:N: specific GPU index when CUDA is available.
  • cpu: CPU.
Parameter Type Default Description
device_setting str - (undocumented)

Returns: torch.device

Raises: RuntimeError: If a CUDA device is requested (cuda or cuda:N) but CUDA is not available.