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

Method partial_graph_forward

ppq/executor/torch.py:654–682  ·  view source on GitHub ↗

This forward function allows you to execute a series operations in your graph. (only operations list in your params will be executed with this function) Which serves as a great feature for quantization aware training. Args: operations (List[Operation]):

(
        self, operations: List[Operation],
        feed_dict: Dict[str, torch.Tensor],
        output_names:List[str])

Source from the content-addressed store, hash-verified

652 self.forward(inputs=feed_dict, hooks=hooks)
653
654 def partial_graph_forward(
655 self, operations: List[Operation],
656 feed_dict: Dict[str, torch.Tensor],
657 output_names:List[str]) -> List[torch.Tensor]:
658 """This forward function allows you to execute a series operations in
659 your graph. (only operations list in your params will be executed with
660 this function) Which serves as a great feature for quantization aware
661 training.
662
663 Args:
664 operations (List[Operation]):
665 operations that you want to execute,
666 notice that executing will strictly follow your operation order.
667
668 feed_dict (Dict[str, torch.Tensor]):
669 an dictionary contains {variable name: value}, as an input to this execution.
670
671 output_names (List[str]):
672 output variable names.
673
674 Returns:
675 List[torch.Tensor]: [description]
676 """
677
678 return self.__forward(
679 inputs=feed_dict,
680 output_names=output_names,
681 executing_order=operations
682 )

Callers 5

calib_blockMethod · 0.80
finetuneMethod · 0.80
compute_block_lossMethod · 0.80
correct_biasMethod · 0.80
finetuneMethod · 0.80

Calls 1

__forwardMethod · 0.95

Tested by

no test coverage detected