SergeiShumilin / differentiable-voronoi

Differentiable Voronoi tessellation on PyTorch for various tasks
3 stars 0 forks source link

assertion inputs differentiable_voronoi (coords, vertex_faces_dict) #2

Open Steven-LeMoal opened 4 months ago

Steven-LeMoal commented 4 months ago

In def differentiable_voronoi, there is (line 422):

assert len(vertex_faces_dict) == len(coords), print(len(vertex_faces_dict), len(coords))

I believe that is because there could be duplicate in coords, you could replace this line by:

if len(vertex_faces_dict) == len(coords):
      coords, _ = torch.unique(coords, return_inverse=True, dim=0)
SergeiShumilin commented 4 months ago

Thank you, Steven!

In this place we would like to keep this assert True because duplicate points are of great problem for the method.

Please let us know if it resolves the issue.