Skip to content

Restore the information of Parameters in Program.clone() #5871

@reyoung

Description

@reyoung

def clone(self):
p = Program()
p.desc = core.ProgramDesc(self.desc)
p.blocks = [Block(p, i) for i in xrange(self.desc.num_blocks())]
p.sync_with_cpp()
return p

The Program.clone only clone the variables and ops in the program into a new program. However, the information of Parameter is not clone.

So we need restore the information of Parameters.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions