MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / to_program

Method to_program

python/paddle/base/framework.py:5968–5984  ·  view source on GitHub ↗

Convert the graph into a Program. WARN: When the graph includes backward operator nodes, the conversion process may be failed. Usually, this function is only used to convert a test graph. Returns: Program: a program converted from the graph.

(self)

Source from the content-addressed store, hash-verified

5966 _convert_to_pdf(viz_dot_path)
5967
5968 def to_program(self):
5969 """
5970 Convert the graph into a Program.
5971
5972 WARN: When the graph includes backward operator nodes, the
5973 conversion process may be failed. Usually, this function is
5974 only used to convert a test graph.
5975
5976 Returns:
5977 Program: a program converted from the graph.
5978 """
5979 convert_pass = core.get_pass("graph_to_program_pass")
5980 desc = core.ProgramDesc()
5981 convert_pass.set_not_owned("program", desc)
5982 convert_pass.apply(self.graph)
5983 program = Program._construct_from_desc(desc)
5984 return program
5985
5986 def _find_node_by_name(self, nodes, node_name):
5987 """

Callers 15

quant_awareFunction · 0.95
convertFunction · 0.95
_optimize_fp32_modelMethod · 0.95
_update_programMethod · 0.95
save_quantized_modelMethod · 0.95
saveMethod · 0.95
_apply_single_implMethod · 0.95
add_build_strategy_forFunction · 0.95
_predictMethod · 0.95
_predictMethod · 0.95
insert_qdqMethod · 0.95

Calls 3

_construct_from_descMethod · 0.80
ProgramDescMethod · 0.45
applyMethod · 0.45

Tested by 7

insert_qdqMethod · 0.76
build_programMethod · 0.76
build_programMethod · 0.76
insert_qdqMethod · 0.76
test_fuse_resnet_unitMethod · 0.64
test_fuse_resnet_unitFunction · 0.64