pylibwholegraph.torch.graph_ops.append_unique#
- pylibwholegraph.torch.graph_ops.append_unique(
- target_node_tensor: Tensor,
- neighbor_node_tensor: Tensor,
- need_neighbor_raw_to_unique: bool = False,
Append neighbor_node_tenosr to target_node_tensor, keep target_node_tensor unchanged and do unique e.g. if target_node_tensor is [3, 11, 2, 10], neighbor_node_tensor is [4, 5, 2, 11, 6, 9, 10, 5], output_unique_node may be [3, 11, 2, 10, 6, 4, 9, 5], order of 6, 4, 9, 5 may change. neighbor_raw_to_unique_mapping will be [5, 7, 2, 1, 4, 6, 3, 7] :param target_node_tensor: target node tensor :param neighbor_node_tensor: neighbor node tensor :param need_neighbor_raw_to_unique: if need to output neighbor_raw_to_unique_mapping :return: output_unique_node and neighbor_raw_to_unique_mapping