def copy_own_vars_from(self, src_net: "Network") -> None:
        """Copy the values of all variables from the given network, excluding sub-networks."""

        # Source has unknown variables or unknown components => init now.
        if (src_net._var_inits is not None and not src_net._all_inits_known) or src_net._components is None:
            src_net._get_vars()

       # Both networks are inited => copy directly.
        if src_net._var_inits is None and self._var_inits is None:
            names = [name for name in self._get_own_vars().keys() if name in src_net._get_own_vars()]
            tfutil.set_vars(tfutil.run({self._get_vars()[name]: src_net._get_vars()[name] for name in names}))
            return

        # Read from source.
        if src_net._var_inits is None:
            value_dict = tfutil.run(src_net._get_own_vars())
        else:
            value_dict = src_net._var_inits

        # Write to destination.
        if self._var_inits is None:
            tfutil.set_vars({self._get_vars()[name]: value for name, value in value_dict.items() if name in self._get_vars()})
        else:
            self._var_inits.update(value_dict)
Copy the values of all variables from the given network, excluding sub-networks.
converters/stylegan2ada_tf_official/dnnlib/tflib/network.py