def save_tensors(filename, tensor_dict):
    """
    Save dict of tensors to file

    Parameters
    ----------
    filename : str
        File name to store dict of tensors.
    tensor_dict: dict of dgl NDArray or backend tensor
        Python dict using string as key and tensor as value

    Returns
    ----------
    status : bool
        Return whether save operation succeeds
    """
    nd_dict = {}
    is_empty_dict = len(tensor_dict) == 0
    for key, value in tensor_dict.items():
        if not isinstance(key, str):
            raise Exception("Dict key has to be str")
        if F.is_tensor(value):
            nd_dict[key] = F.zerocopy_to_dgl_ndarray(value)
        elif isinstance(value, NDArray):
            nd_dict[key] = value
        else:
            raise Exception(
                "Dict value has to be backend tensor or dgl ndarray"
            )

    return _CAPI_SaveNDArrayDict(filename, nd_dict, is_empty_dict)

    Save dict of tensors to file

    Parameters
    ----------
    filename : str
        File name to store dict of tensors.
    tensor_dict: dict of dgl NDArray or backend tensor
        Python dict using string as key and tensor as value

    Returns
    ----------
    status : bool
        Return whether save operation succeeds
    
python/dgl/data/tensor_serialize.py