MCPcopy Index your code
hub / github.com/OpenPPL/ppq / activation_matching

Method activation_matching

ppq/IR/search.py:621–637  ·  view source on GitHub ↗
(
        self, start_op_types: Set[str],
        end_types: Set[str],
    )

Source from the content-addressed store, hash-verified

619 return ret_collection
620
621 def activation_matching(
622 self, start_op_types: Set[str],
623 end_types: Set[str],
624 ) -> Dict[str, List[str]]:
625
626 matchings = self.path_matching(
627 sp_expr = lambda op: op.type in start_op_types,
628 rp_expr = lambda x, y: False, # must have no relay operation.
629 ep_expr = lambda op: op.type in end_types,
630 direction = 'down'
631 )
632
633 activation_matchings = defaultdict(list)
634 for path in matchings:
635 op, act = path[0], path[-1]
636 activation_matchings[op.name].append(act.name)
637 return dict(activation_matchings)
638
639 def concat_matching(
640 self, relay_pattern: Callable,

Callers 1

optimizeMethod · 0.95

Calls 2

path_matchingMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected