class_docstr: Base class for row-wise sharding.
code: def __init__(
      self,
      sharding_infos: List[EmbeddingShardingInfo],
      env: ShardingEnv,
      device: Optional[torch.device] = None,
      need_pos: bool = False,
      qcomm_codecs_registry: Optional[
          Dict[str, QuantizedCommCodecs]
      ] = None,
  ) -> None:
      super().__init__(
          qcomm_codecs_registry=qcomm_codecs_registry,
      )
  
      self._env = env
      self._pg: Optional[dist.ProcessGroup] = self._env.process_group
      self._world_size: int = self._env.world_size
      self._rank: int = self._env.rank
      if device is None:
          device = torch.device("cpu")
      self._device: torch.device = device
      sharded_tables_per_rank = self._shard(sharding_infos)
      self._need_pos = need_pos
      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[self._rank]
  
      self._has_feature_processor: bool = False
      for group_config in self._grouped_embedding_configs:
          if group_config.has_feature_processor:
              self._has_feature_processor = True
  
imports: import math
  from typing import Any, cast, Dict, List, Optional, Tuple, TypeVar, Union
  import torch
  import torch.distributed
  from torchrec.distributed.dist_data import EmbeddingsAllToOneReduce, KJTAllToAll, KJTOneToAll, PooledEmbeddingsReduceScatter, VariableBatchPooledEmbeddingsReduceScatter
  from torchrec.distributed.embedding_lookup import GroupedPooledEmbeddingsLookup, InferGroupedPooledEmbeddingsLookup
  from torchrec.distributed.embedding_sharding import BaseEmbeddingDist, BaseEmbeddingLookup, BaseSparseFeaturesDist, bucketize_kjt_before_all2all, EmbeddingSharding, EmbeddingShardingContext, EmbeddingShardingInfo, group_tables
  from torchrec.distributed.embedding_types import BaseGroupedFeatureProcessor, EmbeddingComputeKernel, GroupedEmbeddingConfig, KJTList, ShardedEmbeddingTable
  from torchrec.distributed.types import Awaitable, CommOp, NullShardingContext, QuantizedCommCodecs, ShardedTensorMetadata, 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 BaseRwEmbeddingSharding object from inherited base classes: EmbeddingSharding with example: obj = BaseRwEmbeddingSharding(sharding_infos, env, device, need_pos, qcomm_codecs_registry)