MCPcopy
hub / github.com/XingangPan/DragGAN / copy_vars_from

Method copy_vars_from

stylegan_human/dnnlib/tflib/network.py:323–326  ·  view source on GitHub ↗

Copy the values of all variables from the given network, including sub-networks.

(self, src_net: "Network")

Source from the content-addressed store, hash-verified

321 tfutil.set_vars(tfutil.run({self.vars[name]: src_net.vars[name] for name in names}))
322
323 def copy_vars_from(self, src_net: "Network") -> None:
324 """Copy the values of all variables from the given network, including sub-networks."""
325 names = [name for name in self.vars.keys() if name in src_net.vars]
326 tfutil.set_vars(tfutil.run({self.vars[name]: src_net.vars[name] for name in names}))
327
328 def copy_trainables_from(self, src_net: "Network") -> None:
329 """Copy the values of all trainable variables from the given network, including sub-networks."""

Callers 2

convertMethod · 0.95
cloneMethod · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected