Commit 116092ec authored by yanyan's avatar yanyan
Browse files

small change

parent d17a00e0
......@@ -60,8 +60,6 @@ class SparseMaxPool(SparseModule):
indices = input.indices
spatial_shape = input.spatial_shape
batch_size = input.batch_size
torch.cuda.synchronize()
t = time.time()
if not self.subm:
out_spatial_shape = ops.get_conv_output_size(
spatial_shape, self.kernel_size, self.stride, self.padding,
......@@ -75,9 +73,6 @@ class SparseMaxPool(SparseModule):
out_features = Fsp.indice_maxpool(features, indice_pairs.to(device),
indice_pairs_num.to(device),
outids.shape[0])
torch.cuda.synchronize()
print("maxpool", spatial_shape, time.time() - t)
out_tensor = spconv.SparseConvTensor(out_features, outids,
out_spatial_shape, batch_size)
out_tensor.indice_dict = input.indice_dict
......
......@@ -56,6 +56,7 @@ class Net(nn.Module):
spconv.SubMConv3d(256, 256, 3, bias=False, indice_key="c6"),
)
max_batch_size = 1
# grid (dense map) is used for indice generation. use pre-allocated grid can run faster.
self.grid = torch.full([max_batch_size, *shape], -1, dtype=torch.int32).cuda()
# self.grid = None
self.shape = shape
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment