def _init_enumerable(self, dims, tensor_init_params: TensorInitParams):
    check_tensor(self._sharding_spec.shards, dims)
    current_rank = dist.get_rank(self._process_group)
    shards_metadata = []
    for shard_metadata in self._sharding_spec.shards:
        (rank, local_device) = _parse_and_validate_remote_device(self._process_group, shard_metadata.placement)
        shards_metadata.append(shard_metadata)
        if (current_rank == rank):
            local_shard = _create_tensor_from_params(*shard_metadata.shard_sizes, local_device=local_device, tensor_init_params=tensor_init_params)
            self._local_shards.append(Shard(local_shard, shard_metadata))
    self._metadata = ShardedTensorMetadata(shards_metadata, dims, tensor_init_params.tensor_properties)
def _init_enumerable(self, dims, tensor_init_params: TensorInitParams):
    check_tensor(self._sharding_spec.shards, dims)
    current_rank = dist.get_rank(self._process_group)
    shards_metadata = []
    for shard_metadata in self._sharding_spec.shards:
        (rank, local_device) = _parse_and_validate_remote_device(self._process_group, shard_metadata.placement)
        shards_metadata.append(shard_metadata)
        if (current_rank == rank):
            local_shard = _create_tensor_from_params(*shard_metadata.shard_sizes, local_device=local_device, tensor_init_params=tensor_init_params)
            self._local_shards.append(Shard(local_shard, shard_metadata))
    self._metadata = ShardedTensorMetadata(shards_metadata, dims, tensor_init_params.tensor_properties)