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)
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
deviceis none of those. -
Return type:
-
DeviceMapping