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

Method tracing_operation_meta

ppq/executor/torch.py:581–602  ·  view source on GitHub ↗

Tracing meta data for each operation, if there are some already created meta data with your operation, They will be override without warrning. Args: inputs (Union[dict, list, torch.Tensor]): [description] output_names (List[str], optional): [descripti

(
        self,
        inputs: Union[dict, list, torch.Tensor],
        output_names: List[str] = None,
    )

Source from the content-addressed store, hash-verified

579 @ torch.no_grad()
580 @ empty_ppq_cache
581 def tracing_operation_meta(
582 self,
583 inputs: Union[dict, list, torch.Tensor],
584 output_names: List[str] = None,
585 ) -> None:
586 """Tracing meta data for each operation, if there are some already
587 created meta data with your operation, They will be override without
588 warrning.
589
590 Args:
591 inputs (Union[dict, list, torch.Tensor]): [description]
592 output_names (List[str], optional): [description]. Defaults to None.
593 """
594 hooks = {}
595 for op_name, operation in self._graph.operations.items():
596 hooks[op_name] = TorchMetaDataTracingHook(operation=operation)
597
598 self.__forward(
599 inputs=inputs,
600 output_names=output_names,
601 executing_order=self._executing_order,
602 hooks=hooks)
603
604 def load_graph(self, graph: BaseGraph) -> dict:
605 super().load_graph(graph)

Callers 15

prepare_modelMethod · 0.95
quantize_onnx_modelFunction · 0.95
quantize_caffe_modelFunction · 0.95
quantize_native_modelFunction · 0.95
yolo6_sample.pyFile · 0.45
fp8_sample.pyFile · 0.45
bert_sample.pyFile · 0.45
fp8_sample.pyFile · 0.45
QuantZoo_Yolo.pyFile · 0.45

Calls 2

__forwardMethod · 0.95

Tested by

no test coverage detected