class_docstr: Base class for row-wise sharding.
code: def _shard(
      self,
      sharding_infos: List[EmbeddingShardingInfo],
  ) -> List[List[ShardedEmbeddingTable]]:
      tables_per_rank: List[List[ShardedEmbeddingTable]] = [
          [] for i in range(self._world_size)
      ]
      for info in sharding_infos:
          # pyre-fixme [16]
          shards = info.param_sharding.sharding_spec.shards
  
          # construct the global sharded_tensor_metadata
          global_metadata = ShardedTensorMetadata(
              shards_metadata=shards,
              size=torch.Size(
                  [
                      info.embedding_config.num_embeddings,
                      info.embedding_config.embedding_dim,
                  ]
              ),
          )
  
          for rank in range(self._world_size):
              tables_per_rank[rank].append(
                  ShardedEmbeddingTable(
                      num_embeddings=info.embedding_config.num_embeddings,
                      embedding_dim=info.embedding_config.embedding_dim,
                      name=info.embedding_config.name,
                      embedding_names=info.embedding_config.embedding_names,
                      data_type=info.embedding_config.data_type,
                      feature_names=info.embedding_config.feature_names,
                      pooling=info.embedding_config.pooling,
                      is_weighted=info.embedding_config.is_weighted,
                      has_feature_processor=info.embedding_config.has_feature_processor,
                      local_rows=shards[rank].shard_sizes[0],
                      local_cols=info.embedding_config.embedding_dim,
                      compute_kernel=EmbeddingComputeKernel(
                          info.param_sharding.compute_kernel
                      ),
                      local_metadata=shards[rank],
                      global_metadata=global_metadata,
                      weight_init_max=info.embedding_config.weight_init_max,
                      weight_init_min=info.embedding_config.weight_init_min,
                      fused_params=info.fused_params,
                  )
              )
      return tables_per_rank
  
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 2 for calling the BaseRwEmbeddingSharding obj's underlying member method code with example usage: obj._shard(sharding_infos) and returns: tables_per_rank