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 class

PerShard

PerShard

class max.experimental.sharding.PerShard(values)

source

Bases: object

A distinct value per mesh shard.

Wraps a sequence of per-shard values so the dispatcher can index into it by mesh shard when forwarding a non-tensor argument to a per-shard op call. Non-PerShard values appearing in ActionSet.extras are treated as uniform across shards.

Parameters:

values (tuple[Any, ...])

values

values: tuple[Any, ...]

source