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 _filter_compute_kernels(
      self,
      name: str,
      allowed_compute_kernels: List[str],
  ) -> List[str]:
      # for the log message only
      constrained_compute_kernels: List[str] = [
          compute_kernel.value
          for compute_kernel in EmbeddingComputeKernel
      ]
      if not self._constraints or not self._constraints.get(name):
          filtered_compute_kernels = allowed_compute_kernels
      else:
          constraints: ParameterConstraints = self._constraints[name]
          if not constraints.compute_kernels:
              filtered_compute_kernels = allowed_compute_kernels
          else:
              constrained_compute_kernels = constraints.compute_kernels
              filtered_compute_kernels = list(
                  set(constrained_compute_kernels)
                  & set(allowed_compute_kernels)
              )
  
      if EmbeddingComputeKernel.DENSE.value in filtered_compute_kernels:
          if (
              EmbeddingComputeKernel.FUSED.value
              in filtered_compute_kernels
          ):  # always false for data_parallel
              filtered_compute_kernels.remove(
                  EmbeddingComputeKernel.DENSE.value
              )
  
      if not filtered_compute_kernels:
          logger.warn(
              "No available compute kernels after applying user provided "
              f"constraints for {name}. Constrained compute kernels: "
              f"{constrained_compute_kernels}, allowed compute kernels: "
              f"{allowed_compute_kernels}, filtered compute kernels: "
              f"{filtered_compute_kernels}. Please check if the constrained "
              "compute kernels are too restrictive, if the sharder allows the "
              "compute kernels, or if non-strings are passed in."
          )
      return filtered_compute_kernels
  
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 5 for calling the EmbeddingEnumerator obj's underlying member method code with example usage: obj._filter_compute_kernels(name, allowed_compute_kernels) and returns: filtered_compute_kernels