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

Method quantize_function

ppq/executor/torch.py:610–613  ·  view source on GitHub ↗
(self, tensor: torch.Tensor, config: TensorQuantizationConfig = None)

Source from the content-addressed store, hash-verified

608 self._runnable_graph(GraphDeployCommand(device=self._device))
609
610 def quantize_function(self, tensor: torch.Tensor, config: TensorQuantizationConfig = None) -> torch.Tensor:
611 if config is None or not QuantizationStates.is_activated(config.state): return tensor
612 elif config in self._delegates: return self._delegates[config](tensor, config)
613 else: return self._default_quant_fn(tensor, config)
614
615 def dummy_forward(self, hooks: Dict[str, RuntimeHook] = None) -> None:
616 """This function allows you to execute entire graph without feeding any

Callers 1

__forwardMethod · 0.95

Calls 1

is_activatedMethod · 0.80

Tested by

no test coverage detected