(self, tensor, group, partition_meta=None)
| 743 | class PartitionedTensor: |
| 744 | |
| 745 | def __init__(self, tensor, group, partition_meta=None): |
| 746 | super().__init__() |
| 747 | |
| 748 | self.group = group |
| 749 | self.num_parts = dist.get_world_size(group=self.group) |
| 750 | self.rank = dist.get_rank(group=self.group) |
| 751 | self.orig_size = list(tensor.size()) |
| 752 | self.orig_device = tensor.device |
| 753 | self.local_data, self.partition = self._partition_tensor(tensor) |
| 754 | self.even_split = tensor.numel() % self.num_parts == 0 |
| 755 | |
| 756 | @classmethod |
| 757 | def from_meta(cls, meta, local_part, group, device=get_accelerator().device_name()): |
nothing calls this directly
no test coverage detected