class_docstr: Base class for data-parallel sharding.
class_docstr_tok: ["Base","class","for","data-parallel","sharding","."]
code: def __init__(
      self,
      sharding_infos: List[EmbeddingShardingInfo],
      env: ShardingEnv,
      device: Optional[torch.device] = None,
  ) -> None:
      super().__init__()
      self._env = env
      self._device = device
      self._rank: int = self._env.rank
      self._world_size: int = self._env.world_size
      sharded_tables_per_rank = self._shard(sharding_infos)
      self._grouped_embedding_configs_per_rank: List[
          List[GroupedEmbeddingConfig]
      ] = []
      self._grouped_embedding_configs_per_rank = group_tables(
          sharded_tables_per_rank
      )
      self._grouped_embedding_configs: List[
          GroupedEmbeddingConfig
      ] = self._grouped_embedding_configs_per_rank[env.rank]
  
imports: from typing import Any, cast, Dict, List, Optional, TypeVar
  import torch
  from torchrec.distributed.embedding_lookup import GroupedPooledEmbeddingsLookup
  from torchrec.distributed.embedding_sharding import BaseEmbeddingDist, BaseEmbeddingLookup, BaseSparseFeaturesDist, EmbeddingSharding, EmbeddingShardingContext, EmbeddingShardingInfo, group_tables
  from torchrec.distributed.embedding_types import BaseGroupedFeatureProcessor, EmbeddingComputeKernel, GroupedEmbeddingConfig, ShardedEmbeddingTable
  from torchrec.distributed.types import Awaitable, NoWait, ShardingEnv, ShardMetadata
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
  from torchrec.streamable import Multistreamable
label_desc: Use image node_id 1 to create a new BaseDpEmbeddingSharding object from inherited base classes: EmbeddingSharding with example: obj = BaseDpEmbeddingSharding(sharding_infos, env, device)