IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python function

as_device_mapping

as_device_mapping()โ€‹

max.experimental.sharding.as_device_mapping(device)

source

Coerces any way of naming where a value sits into a mapping.

Parameters:

device (Device | DeviceRef | DeviceMesh | DeviceMapping) โ€“ A single device, a mesh to replicate over, or a mapping.

Returns:

The equivalent DeviceMapping.

Raises:

TypeError โ€“ If device is none of those.

Return type:

DeviceMapping