Copy the information of Operator information from other program. Args: other(Program): Other program Returns: None
(self, other: Program)
| 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 | """ |
no test coverage detected