Skip to content

Commit

Permalink
skip backprop in case no grouped indices are available (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangruhuang authored Apr 13, 2022
1 parent 878ad2e commit 846cf3e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pcdet/ops/pointnet2/pointnet2_stack/pointnet2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ def backward(ctx, grad_new_features: torch.Tensor, grad_local_xyz: torch.Tensor,
point_cnt_of_grid, grouped_idxs, N, num_c_in = ctx.vector_pool_for_backward
grad_support_features = grad_new_features.new_zeros((N, num_c_in))

pointnet2.vector_pool_grad_wrapper(
grad_new_features.contiguous(), point_cnt_of_grid, grouped_idxs,
grad_support_features
)
if grouped_idxs.shape[0] > 0:
pointnet2.vector_pool_grad_wrapper(
grad_new_features.contiguous(), point_cnt_of_grid, grouped_idxs,
grad_support_features
)

return None, None, grad_support_features, None, None, None, None, None, None, None, None, None, None, None, None

Expand Down

0 comments on commit 846cf3e

Please sign in to comment.