import torch


def get_init_node_embedding(graphs, node_emb_size=100):
    """initialize node embedding
    
    If two nodes in different graphs have the same value, these two nodes will have the same initial embedding.

    Args:
        graphs: a list of graphs
        node_emb_size: node embedding size

    Returns: 
        nodes_embedding: a Tensor which denotes the initial embedding of nodes
        node_ix_dict: a dict whose key is TempNode and value is the ix in embedding 
    """
    nodes = [node for graph in graphs for _, node in graph.nodes.items()]
    node_num = len(nodes)
    node_ix_dict = {node:ix for ix, node in enumerate(nodes)}
    init_node_embedding = torch.empty(node_num, node_emb_size)
    torch.nn.init.xavier_normal_(init_node_embedding)
    return init_node_embedding