SparseConv module that operates on torch.Tensor
| 45 | return y_s.features.reshape(B, -1, y_s.features.shape[-1]) |
| 46 | |
| 47 | class SparseAvgPool2d(ME.MinkowskiAvgPooling): |
| 48 | '''SparseConv module that operates on torch.Tensor |
| 49 | ''' |
| 50 | def __init__(self, *args, **kwargs) -> None: |
| 51 | super().__init__(*args, **kwargs, dimension=2) |
| 52 | |
| 53 | def forward(self, x: torch.Tensor, indexes: torch.Tensor, H: int = None, W: int = None): |
| 54 | B, L, C = x.shape |
| 55 | x_s = to_sparse_tensor(x, indexes) |
| 56 | y_s = super().forward(x_s) |
| 57 | # the number of elements might be different |
| 58 | return y_s.features.reshape(B, -1, y_s.features.shape[-1]) |
nothing calls this directly
no outgoing calls
no test coverage detected