MCPcopy Create free account
hub / github.com/pytorch/executorch / annotate

Method annotate

backends/example/example_quantizer.py:82–101  ·  view source on GitHub ↗
(self, model)

Source from the content-addressed store, hash-verified

80 self.quant_config = default_static_config
81
82 def annotate(self, model):
83 for supported_modules in self.quantizer_supported_modules:
84 # print("supported modules: ", supported_modules)
85 fused_partitions = find_sequential_partitions(
86 model,
87 list(supported_modules),
88 )
89
90 for partitions in fused_partitions:
91 if check_for_outside_users(partitions):
92 continue
93
94 source_module_list = ()
95 for partition in partitions:
96 source_module_list += (partition,)
97
98 annotator = module_to_annotator[supported_modules].annotate_handle
99 annotator(partitions, self.quant_config)
100
101 return model
102
103 def validate(self, model: fx.GraphModule) -> None:
104 pass

Callers

nothing calls this directly

Calls 1

check_for_outside_usersFunction · 0.85

Tested by

no test coverage detected