pyt-team / TopoModelX

Topological Deep Learning
MIT License
219 stars 79 forks source link

Possible bug in scatter_sum #228

Open soham0209 opened 11 months ago

soham0209 commented 11 months ago

The bug happens when the last cell / simplex (index-wise) is isolated. Simple code to reproduce the issue:

from toponetx.classes.cell_complex import CellComplex
import torch
from topomodelx.base.conv import Conv

if __name__ == '__main__':
    complex = CellComplex()
    complex.add_cell([0,1,2], 2)
    complex.add_cell([0,1,3], 2)
    complex.add_node(4)
    vertex_feats = torch.zeros(5, 3)
    hidden_dim = 8
    A0 = torch.from_numpy(complex.adjacency_matrix(rank=0).todense()).to_sparse().float()

conv_0_to_0 = Conv(
            in_channels=in_channels_0, out_channels=in_channels_0, att=False
        )

    zv = conv_0_to_0(vertex_feats, A0)