class_docstr: Generates embedding sharding options for given `nn.Module`, considering user provided
  constraints.
  
  Args:
      topology (Topology): device topology.
      batch_size (int): batch size.
      constraints (Optional[Dict[str, ParameterConstraints]]): dict of parameter names
          to provided ParameterConstraints.
class_docstr_tok: ["Generates","embedding","sharding","options","for","given","`","nn.Module","`",",","considering","user","provided","constraints",".","Args",":","topology","(","Topology",")",":","device","topology",".","batch_size","(","int",")",":","batch","size",".","constraints","(","Optional","[","Dict","[","str",",","ParameterConstraints","]","]",")",":","dict","of","parameter","names","to","provided","ParameterConstraints","."]
code: def __init__(
      self,
      topology: Topology,
      batch_size: int,
      constraints: Optional[Dict[str, ParameterConstraints]] = None,
      estimator: Optional[
          Union[ShardEstimator, List[ShardEstimator]]
      ] = None,
  ) -> None:
      self._compute_device: str = topology.compute_device
      self._world_size: int = topology.world_size
      self._local_world_size: int = topology.local_world_size
      self._batch_size: int = batch_size
      self._constraints = constraints
      self._sharder_map: Dict[str, ModuleSharder[nn.Module]] = {}
  
      if estimator:
          self._estimators: List[ShardEstimator] = (
              [estimator]
              if not isinstance(estimator, list)
              else estimator
          )
      else:
          self._estimators: List[ShardEstimator] = [
              EmbeddingPerfEstimator(
                  topology=topology, constraints=constraints
              ),
              EmbeddingStorageEstimator(
                  topology=topology, constraints=constraints
              ),
          ]
  
imports: import logging
  from typing import Dict, List, Optional, Tuple, Union
  from torch import nn
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.planner.constants import POOLING_FACTOR
  from torchrec.distributed.planner.shard_estimators import EmbeddingPerfEstimator, EmbeddingStorageEstimator
  from torchrec.distributed.planner.types import Enumerator, ParameterConstraints, PartitionByType, Shard, ShardEstimator, ShardingOption, Topology
  from torchrec.distributed.planner.utils import sharder_name
  from torchrec.distributed.sharding_plan import calculate_shard_sizes_and_offsets
  from torchrec.distributed.types import BoundsCheckMode, CacheParams, ModuleSharder, ShardingType
  from torchrec.modules.embedding_tower import EmbeddingTower, EmbeddingTowerCollection
label_desc: Use image node_id 1 to create a new EmbeddingEnumerator object from inherited base classes: Enumerator with example: obj = EmbeddingEnumerator(topology, batch_size, constraints, estimator)