MCPcopy
hub / github.com/OpenPPL/ppq / __init__

Method __init__

ppq/quantization/quantizer/base.py:17–28  ·  view source on GitHub ↗
(
        self,
        graph: BaseGraph,
        verbose: bool = True
    )

Source from the content-addressed store, hash-verified

15
16class BaseQuantizer(metaclass = ABCMeta):
17 def __init__(
18 self,
19 graph: BaseGraph,
20 verbose: bool = True
21 ) -> None:
22 if not isinstance(graph, BaseGraph):
23 raise TypeError(f'To initialize a Quantizer, a BaseGraph instance is needed.'\
24 f' While {type(graph)} was givne, if your graph is maintained by GraphCommandProcessor, '\
25 'use GraphCommandProcessor.graph here instead.')
26 self._verbose = verbose
27 self._graph = graph
28 self._processor = QuantableGraph(GraphReplacer(self._graph))
29
30 @ empty_ppq_cache
31 def quantize(

Callers

nothing calls this directly

Calls 2

QuantableGraphClass · 0.90
GraphReplacerClass · 0.90

Tested by

no test coverage detected