code: def __init__(
      self,
      world_size: int,
      num_features: int,
      feature_hash_sizes: List[int],
      device: Optional[torch.device] = None,
      is_sequence: bool = False,
      has_feature_processor: bool = False,
      need_pos: bool = False,
      embedding_shard_metadata: Optional[List[List[int]]] = None,
  ) -> None:
      super().__init__()
      self._world_size: int = world_size
      self._num_features = num_features
      self.feature_block_sizes: List[int] = [
          (hash_size + self._world_size - 1) // self._world_size
          for hash_size in feature_hash_sizes
      ]
      self.tensor_cache: Dict[
          str, Tuple[torch.Tensor, Optional[List[torch.Tensor]]]
      ] = {}
  
      self._dist = KJTOneToAll(
          splits=self._world_size * [self._num_features],
          world_size=world_size,
          device=device,
      )
      self._is_sequence = is_sequence
      self._has_feature_processor = has_feature_processor
      self._need_pos = need_pos
      self.unbucketize_permute_tensor: Optional[torch.Tensor] = None
  
      self._embedding_shard_metadata: Optional[
          List[List[int]]
      ] = embedding_shard_metadata
  
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 InferRwSparseFeaturesDist object from inherited base classes: BaseSparseFeaturesDist with example: obj = InferRwSparseFeaturesDist(world_size, num_features, feature_hash_sizes, device, is_sequence, has_feature_processor, need_pos, embedding_shard_metadata)