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_layout
as_layout()
max.experimental.sharding.as_layout(layout)
Normalizes a declared layout.
Takes a declaration, never a value: a live tensor’s dims are whatever it
currently holds, so reading a layout off one would fix every dimension to
that. Anything holding a layout of its own is refused, and told to
pass it.
A single-device max.graph type is accepted and coerced, so the
graph types stay usable without appearing in any signature. A
BufferType coerces to a BufferLayout,
carrying its declaration across.
-
Parameters:
-
layout (object) – A
TensorLayoutorBufferLayoutto take as given, or a single-deviceTensorTypeorBufferType. -
Returns:
-
The equivalent layout.
-
Raises:
-
TypeError – If
layoutis a value rather than a declaration, or describes no layout at all. -
Return type: