Skip to content

Commit

Permalink
move spconv_utils.py to pcdet/utils/, update find_all_spconv_keys()
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaoshuai committed Nov 23, 2021
1 parent 511244e commit cddcf9b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pcdet/models/backbones_3d/spconv_backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import torch.nn as nn

from ...spconv_utils import replace_feature, spconv
from ...utils.spconv_utils import replace_feature, spconv


def post_act_block(in_channels, out_channels, kernel_size, indice_key=None, stride=1, padding=0,
Expand Down
2 changes: 1 addition & 1 deletion pcdet/models/backbones_3d/spconv_unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import torch.nn as nn

from ...spconv_utils import replace_feature, spconv
from ...utils.spconv_utils import replace_feature, spconv
from ...utils import common_utils
from .spconv_backbone import post_act_block

Expand Down
2 changes: 1 addition & 1 deletion pcdet/models/roi_heads/partA2_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch.nn as nn

from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...spconv_utils import spconv
from ...utils.spconv_utils import spconv
from .roi_head_template import RoIHeadTemplate


Expand Down
2 changes: 1 addition & 1 deletion pcdet/spconv_utils.py → pcdet/utils/spconv_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def find_all_spconv_keys(model: nn.Module, prefix="") -> Set[str]:
for name, child in model.named_children():
new_prefix = f"{prefix}.{name}" if prefix != "" else name

if isinstance(child, (spconv.SubMConv3d, spconv.SparseConv3d, spconv.SparseInverseConv3d)):
if isinstance(child, spconv.conv.SparseConvolution):
new_prefix = f"{new_prefix}.weight"
found_keys.add(new_prefix)

Expand Down

0 comments on commit cddcf9b

Please sign in to comment.