def save_embedding_txt(self, dataset, file_name):
        """Write embedding to local file. For future use.

        Parameter
        ---------
        dataset DeepwalkDataset : the dataset
        file_name str : the file name
        """
        embedding = self.u_embeddings.weight.cpu().data.numpy()
        if self.norm:
            embedding /= np.sqrt(np.sum(embedding * embedding, 1)).reshape(
                -1, 1
            )
        with open(file_name, "w") as f:
            f.write("%d %d\n" % (self.emb_size, self.emb_dimension))
            for wid in range(self.emb_size):
                e = " ".join(map(lambda x: str(x), embedding[wid]))
                f.write("%s %s\n" % (str(dataset.id2node[wid]), e))
Write embedding to local file. For future use.

        Parameter
        ---------
        dataset DeepwalkDataset : the dataset
        file_name str : the file name
        
examples/pytorch/ogb/deepwalk/model.py