IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Python function

make_per_shard_dim

make_per_shard_dim()

max.experimental.sharding.make_per_shard_dim(per_shard, *, force_wrap=False)

source

Wraps per_shard in a PerShardDim, or collapses to a plain Dim.

Collapses to per_shard[0] when every entry is equal. Pass force_wrap=True to keep the wrapper even when entries happen to be equal (used on Sharded axes so global_dim() recovers the global extent by summing).

Parameters:

Return type:

Dim