code: def group_activation_quantization_modules_by_id(
      model: _fx.GraphModule,
  ) -> _Dict[int, _List[_fx.Node]]:
      """
      Groups activation post process layers by their ids. This is useful
      because multiple activation post process modules in a traced graph may
      point to the same module.
      """
      groups = defaultdict(list)
      for node in model.graph.nodes:
          if node.op == "call_module":
              module = find_target(model, node.target)
              if is_activation_post_process(module) and is_quantized(
                  module
              ):
                  groups[id(module)].append(node)
      return groups
  
imports: import operator
  from collections import defaultdict
  from enum import Enum
  from typing import Dict
  from typing import List
  from typing import Optional
  import torch
  import torch.ao.quantization
  import torch.fx
  from torch.ao.quantization.backend_config import BackendConfig
  from torch.ao.quantization.backend_config import ObservationType
  from coremltools.optimize.torch._utils.version_utils import is_torch_2
label_desc: Use image node_id 11 for calling a global function with example usage: group_activation_quantization_modules_by_id(model) and returns: groups