def load_tensors(filename, return_dgl_ndarray=False):
    """
    load dict of tensors from file

    Parameters
    ----------
    filename : str
        File name to load dict of tensors.
    return_dgl_ndarray: bool
        Whether return dict of dgl NDArrays or backend tensors

    Returns
    ---------
    tensor_dict : dict
        dict of tensor or ndarray based on return_dgl_ndarray flag
    """
    nd_dict = _CAPI_LoadNDArrayDict(filename)
    tensor_dict = {}
    for key, value in nd_dict.items():
        if return_dgl_ndarray:
            tensor_dict[key] = value
        else:
            tensor_dict[key] = F.zerocopy_from_dgl_ndarray(value)
    return tensor_dict

    load dict of tensors from file

    Parameters
    ----------
    filename : str
        File name to load dict of tensors.
    return_dgl_ndarray: bool
        Whether return dict of dgl NDArrays or backend tensors

    Returns
    ---------
    tensor_dict : dict
        dict of tensor or ndarray based on return_dgl_ndarray flag
    
python/dgl/data/tensor_serialize.py