def load_and_assign_npz(sess=None, name=None, network=None):
if network is None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if sess is None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not os.path.exists(name):<EOL><INDENT>logging.error("<STR_LIT>".format(name))<EOL>return False<EOL><DEDENT>else:<EOL><INDENT>params = load_npz(name=name)<EOL>assign_params(sess, params, network)<EOL>logging.info("<STR_LIT>".format(name))<EOL>return network<EOL><DEDENT>
Load model from npz and assign to a network.

    Parameters
    -------------
    sess : Session
        TensorFlow Session.
    name : str
        The name of the `.npz` file.
    network : :class:`Layer`
        The network to be assigned.

    Returns
    --------
    False or network
        Returns False, if the model is not exist.

    Examples
    --------
    - See ``tl.files.save_npz``