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

Method _copy_operator_info_from

python/paddle/base/framework.py:7424–7441  ·  view source on GitHub ↗

Copy the information of Operator information from other program. Args: other(Program): Other program Returns: None

(self, other: Program)

Source from the content-addressed store, hash-verified

7422 var.stop_gradient = True
7423
7424 def _copy_operator_info_from(self, other: Program):
7425 """
7426 Copy the information of Operator information from other program.
7427
7428 Args:
7429 other(Program): Other program
7430
7431 Returns:
7432 None
7433 """
7434 if not isinstance(other, Program):
7435 raise TypeError(
7436 f"Function Program._copy_operator_info_from() needs to pass in a source Program, but received {type(other)}"
7437 )
7438 for dst_block, src_block in zip(self.blocks, other.blocks):
7439 for dst_op, src_op in zip(dst_block.ops, src_block.ops):
7440 dst_op.set_amp_options(src_op.amp_options)
7441 dst_op.struct_name = src_op.struct_name
7442
7443 def list_vars(self):
7444 """

Callers 2

cloneMethod · 0.95
_prune_with_inputMethod · 0.95

Calls 3

TypeErrorClass · 0.85
set_amp_optionsMethod · 0.80
typeFunction · 0.50

Tested by

no test coverage detected