Closed taochenshh closed 2 years ago
If the coords are torch array, sparse_collate
still works if we don't have the assertions.
x = torch.randn(10, 200, 3)
y = torch.randn(10, 200, 3)
xb, yb = sparse_collate(x,y) # here I commented out the assertions
xb2, yb2 = sparse_collate(list(x), list(y))
torch.eq(xb, xb2).all()
Suppose I have a list of coords that are in the form of numpy array or torch tensor. For example, instead of having a list of point cloud, I have an array of point cloud
A
that has the shape of[200, 5000, 3]
where200
is the number of point cloud,5000
is the number of points per point cloud. With the current code (sparse_collate), it seems that I need to first convert this array into a list using something likelist(A)
first before it's passed tosparse_collate
. However, the asserts here are not necessary and the conversion to the list is unnecessary. I wonder what's the logic behind these assertions or perhaps we can add another assertion that allows coords to be a numpy or torch array withndim=3
.