def save_npz(save_list=None, name='<STR_LIT>', sess=None):
logging.info("<STR_LIT>" % name)<EOL>if save_list is None:<EOL><INDENT>save_list = []<EOL><DEDENT>save_list_var = []<EOL>if sess:<EOL><INDENT>save_list_var = sess.run(save_list)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>save_list_var.extend([v.eval() for v in save_list])<EOL><DEDENT>except Exception:<EOL><INDENT>logging.info(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>np.savez(name, params=save_list_var)<EOL>save_list_var = None<EOL>del save_list_var<EOL>logging.info("<STR_LIT>")<EOL>
Input parameters and the file name, save parameters into .npz file. Use tl.utils.load_npz() to restore.

    Parameters
    ----------
    save_list : list of tensor
        A list of parameters (tensor) to be saved.
    name : str
        The name of the `.npz` file.
    sess : None or Session
        Session may be required in some case.

    Examples
    --------
    Save model to npz

    >>> tl.files.save_npz(network.all_params, name='model.npz', sess=sess)

    Load model from npz (Method 1)

    >>> load_params = tl.files.load_npz(name='model.npz')
    >>> tl.files.assign_params(sess, load_params, network)

    Load model from npz (Method 2)

    >>> tl.files.load_and_assign_npz(sess=sess, name='model.npz', network=network)

    Notes
    -----
    If you got session issues, you can change the value.eval() to value.eval(session=sess)

    References
    ----------
    `Saving dictionary using numpy <http://stackoverflow.com/questions/22315595/saving-dictionary-of-header-information-using-numpy-savez>`__