Skip to content

remove_self_loops mutates dense/sparse GNNGraph inputs in place #658

@Parvm1102

Description

@Parvm1102

remove_self_loops is also changing the original graph which is not the expected behaviour

MWE

using GNNGraphs

g = GNNGraph([1 1; 0 1]; graph_type = :dense)
g2 = remove_self_loops(g)

adjacency_matrix(g)   # g will be changed
adjacency_matrix(g2)  # same
g.graph === g2.graph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions