Create a clone of this network with its own copy of the variables.
(self, name: str = None, **new_static_kwargs)
| 301 | tfutil.set_vars({self.find_var(name): value for name, value in state["variables"]}) |
| 302 | |
| 303 | def clone(self, name: str = None, **new_static_kwargs) -> "Network": |
| 304 | """Create a clone of this network with its own copy of the variables.""" |
| 305 | # pylint: disable=protected-access |
| 306 | net = object.__new__(Network) |
| 307 | net._init_fields() |
| 308 | net.name = name if name is not None else self.name |
| 309 | net.static_kwargs = util.EasyDict(self.static_kwargs) |
| 310 | net.static_kwargs.update(new_static_kwargs) |
| 311 | net._build_module_src = self._build_module_src |
| 312 | net._build_func_name = self._build_func_name |
| 313 | net._build_func = self._build_func |
| 314 | net._init_graph() |
| 315 | net.copy_vars_from(self) |
| 316 | return net |
| 317 | |
| 318 | def copy_own_vars_from(self, src_net: "Network") -> None: |
| 319 | """Copy the values of all variables from the given network, excluding sub-networks.""" |
no test coverage detected