Placement¶
- class paddle.distributed. Placement
-
The Placement is base class that describes how to place the tensor on ProcessMesh. it has three subclass: Replicate, Shard and Partial.
Examples
>>> import paddle.distributed as dist >>> placements = [dist.Replicate(), dist.Shard(0), dist.Partial()] >>> for p in placements: >>> if isinstance(p, dist.Placement): >>> if p.is_replicated(): >>> print("replicate.") >>> elif p.is_shard(): >>> print("shard.") >>> elif p.is_partial(): >>> print("partial.")
-
is_partial
(
self: paddle.base.libpaddle.Placement
)
bool
is_partial¶
-
is_replicated
(
self: paddle.base.libpaddle.Placement
)
bool
is_replicated¶
-
is_shard
(
self: paddle.base.libpaddle.Placement,
dim: Optional[int] = None
)
bool
is_shard¶
-
is_partial
(
self: paddle.base.libpaddle.Placement
)
bool