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

Method _construct_from_desc

python/paddle/base/framework.py:7122–7136  ·  view source on GitHub ↗

Construct a program from program desc. Args: desc(core.ProgramDesc): The program desc for constructing. Returns: Program: A program.

(desc)

Source from the content-addressed store, hash-verified

7120
7121 @staticmethod
7122 def _construct_from_desc(desc):
7123 """
7124 Construct a program from program desc.
7125
7126 Args:
7127 desc(core.ProgramDesc): The program desc for constructing.
7128
7129 Returns:
7130 Program: A program.
7131 """
7132 p = Program()
7133 p.desc = desc
7134 p.blocks = [Block(p, i) for i in range(p.desc.num_blocks())]
7135 p._sync_with_cpp()
7136 return p
7137
7138 @property
7139 def random_seed(self):

Callers 3

compileMethod · 0.80
to_programMethod · 0.80
__i_m_p_l__Method · 0.80

Calls 5

_sync_with_cppMethod · 0.95
rangeFunction · 0.85
num_blocksMethod · 0.80
ProgramClass · 0.70
BlockClass · 0.70

Tested by

no test coverage detected