def _mark_act_post_process_for_replacement(
        self,
        node: _fx.Node,
        model: _fx.GraphModule,
        new_act_post_process: _Optional[_aoquant.FakeQuantizeBase] = None,
    ):
        """
        Marks an activation post process layer (activation quantizer) for replacement.
        """
        shared_qparam_nodes = []
        if len(node.users) == 1:
            next_node = list(node.users.keys())[0]
            next_module = _find_module(model, next_node)
            if _is_activation_post_process(next_module) and _is_quantized(next_module):
                module_to_replace_id = id(model.get_submodule(next_node.target))
                # Some mods share the activation quantizer being replaced here,
                # so we collect all those mods here so that those can be pointed to
                # the new replaced module
                for child_node in self._act_quant_groups[module_to_replace_id]:
                    consumer_node = child_node.args[0]
                    if consumer_node.op == "call_module":
                        child_mod = _find_module(model, consumer_node)
                        if type(child_mod) in self._share_qparams_ops:
                            shared_qparam_nodes.append(child_node)
                            self._modules_to_replace[child_node] = []
                    elif consumer_node.op == "call_function":
                        if consumer_node.target in self._share_qparams_ops:
                            shared_qparam_nodes.append(child_node)
                            self._modules_to_replace[child_node] = []
                self._modules_to_replace[next_node] = shared_qparam_nodes
                if new_act_post_process is None:
                    new_act_post_process = self._get_affine_act_post_process_mod_from_symmetric(
                        next_module
                    )
                self._new_act_post_process[next_node] = new_act_post_process

        Marks an activation post process layer (activation quantizer) for replacement.
        
coremltools/optimize/torch/quantization/_configure.py