_distributed.pyi 598 B

123456789101112131415161718192021
  1. # This module is defined in torch/csrc/distributed/python_placement.cpp
  2. class Placement:
  3. def is_partial(self, reduce_op: str | None = None) -> bool: ...
  4. def is_replicate(self) -> bool: ...
  5. def is_shard(self, dim: int | None = None) -> bool: ...
  6. class Shard(Placement):
  7. dim: int
  8. def __init__(self, dim: int): ...
  9. class StridedShard(Placement):
  10. dim: int
  11. split_factor: int
  12. def __init__(self, dim: int, *, split_factor: int): ...
  13. class Replicate(Placement): ...
  14. class Partial(Placement):
  15. reduce_op: str
  16. def __init__(self, reduce_op: str | None = None): ...