code: def quantize_dense(
      predict_module: PredictModule,
      dtype: torch.dtype,
      additional_embedding_module_type: List[Type[nn.Module]] = [],
  ) -> nn.Module:
      module = predict_module.predict_module
      reassign = {}
  
      for name, mod in module.named_children():
          # both fused modules and observed custom modules are
          # swapped as one unit
          if not (
              isinstance(mod, EmbeddingBagCollectionInterface)
              or isinstance(mod, EmbeddingCollectionInterface)
              or any(
                  [
                      type(mod) is clazz
                      for clazz in additional_embedding_module_type
                  ]
              )
          ):
              if dtype == torch.half:
                  new_mod = mod.half()
                  new_mod.register_forward_pre_hook(quantize_feature)
                  reassign[name] = new_mod
              else:
                  raise NotImplementedError(
                      "only fp16 is supported for non-embedding module lowering"
                  )
      for key, value in reassign.items():
          module._modules[key] = value
      return predict_module
  
imports: import abc
  import json
  from dataclasses import asdict, dataclass
  from typing import Any, Dict, List, Optional, Tuple, Type
  import torch
  import torch.nn
  import torch.quantization
  import torchrec
  import torchrec.quant
  from torchrec.modules.embedding_configs import QuantConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollectionInterface, EmbeddingCollectionInterface
label_desc: Use image node_id 4 for calling a global function with example usage: quantize_dense(predict_module, dtype, additional_embedding_module_type) and returns: predict_module