code: def prune_and_quantize_model(
      model: torch.nn.Module,
      pruning_ebc_dict: Dict[str, torch.Tensor],
      ebc_target: str,
  ) -> torch.nn.Module:
      ebc = model.get_submodule(ebc_target)
      setattr(
          ebc,
          MODULE_ATTR_EMB_CONFIG_NAME_TO_PRUNING_INDICES_REMAPPING_DICT,
          pruning_ebc_dict,
      )
  
      quant_state_dict_split_scale_bias = True
      quant_model = quantize(
          module=model,
          inplace=False,
          quant_state_dict_split_scale_bias=quant_state_dict_split_scale_bias,
      )
  
      return quant_model
  
file_path: torchrec/torchrec/distributed/tests/test_quant_pruning.py
imports: import io
  import unittest
  from typing import Dict, List, Tuple
  import torch
  from torchrec.distributed.embedding_types import ShardingType
  from torchrec.distributed.quant_state import sharded_tbes_weights_spec, WeightSpec
  from torchrec.distributed.test_utils.infer_utils import assert_close, assert_weight_spec, create_test_model, create_test_model_ebc_only_no_quantize, model_input_to_forward_args, prep_inputs, quantize, shard_qebc
  from torchrec.fx import symbolic_trace
  from torchrec.quant.embedding_modules import MODULE_ATTR_EMB_CONFIG_NAME_TO_PRUNING_INDICES_REMAPPING_DICT
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
label_desc: Use image node_id 1 for calling a global function with example usage: prune_and_quantize_model(model, pruning_ebc_dict, ebc_target) and returns: quant_model