Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to align the order of indices #713

Open
repoww opened this issue Jul 24, 2024 · 1 comment
Open

how to align the order of indices #713

repoww opened this issue Jul 24, 2024 · 1 comment

Comments

@repoww
Copy link

repoww commented Jul 24, 2024

pooling = spconv.SparseAvgPool3d(kernel_size=2, stride=2)
conv1= spconv.SparseConv3d(
        3,
        3,
        2,
        stride=2,
        padding=0,
        dilation=1,
        bias=False
    )
data = spconv.SparseConvTensor(
        features=features.cuda(),
        indices=batch_indices.cuda(),
        spatial_shape=batch_indices.max(0)[0][1:] + 1,
        batch_size=1
    )
coordinates = spconv.SparseConvTensor(
        features=raw_coordinates.cuda(),
        indices=batch_indices.cuda(),
        spatial_shape=batch_indices.max(0)[0][1:] + 1,
        batch_size=1
    )

coords = pooling(coordinates)
embeddings = conv1(data)

How can I align the indices of coords and embbeddings to be the same to use coords as input of positional encoding.
The two inputs share the same indices, with conv(stride=2) and pooling(stride=2), the output indices should be the same?

Looks like the set of the conv output and pooling output indices are the same but in different orders.

Thanks

@repoww
Copy link
Author

repoww commented Jul 24, 2024

Probably, I should do pooling of raw_coordinates based on the indice_dict from embeddings and just replace the features of embeddings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant