code: def quantize_sharded_embeddings(
      module: torch.nn.Module, dtype: torch.dtype
  ) -> torch.nn.Module:
      qconfig = quant.QConfigDynamic(
          activation=quant.PlaceholderObserver,
          weight=quant.PlaceholderObserver.with_args(dtype=dtype),
      )
      return quant.quantize_dynamic(
          module,
          qconfig_spec={
              BatchedFusedEmbeddingBag: qconfig,
              BatchedDenseEmbeddingBag: qconfig,
              BatchedDenseEmbedding: qconfig,
              BatchedFusedEmbedding: qconfig,
          },
          mapping={
              BatchedFusedEmbeddingBag: QuantBatchedEmbeddingBag,
              BatchedDenseEmbeddingBag: QuantBatchedEmbeddingBag,
              BatchedDenseEmbedding: QuantBatchedEmbedding,
              BatchedFusedEmbedding: QuantBatchedEmbedding,
          },
          inplace=False,
      )
  
imports: import os
  import unittest
  import hypothesis.strategies
  import torch
  import torch.distributed
  import torch.quantization
  from hypothesis import given, settings, Verbosity
  from torchrec.distributed.embedding_lookup import BatchedDenseEmbedding, BatchedDenseEmbeddingBag, BatchedFusedEmbedding, BatchedFusedEmbeddingBag, GroupedEmbeddingsLookup, GroupedPooledEmbeddingsLookup
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel, GroupedEmbeddingConfig, ShardedEmbeddingTable, ShardedTensorMetadata, ShardMetadata
  from torchrec.distributed.quant_embedding_kernel import QuantBatchedEmbedding, QuantBatchedEmbeddingBag
  from torchrec.modules.embedding_configs import DataType, PoolingType
  from torchrec.test_utils import get_free_port
label_desc: Use image node_id 1 for calling a global function with example usage: quantize_sharded_embeddings(module, dtype) and returns: quant