Skip to content

Commit 13f50f7

Browse files
authored
[Fix] Fix docstring (open-mmlab#341)
* fix docstring * check inflate_style in kwargs * fix * Update resnet3d.py
1 parent a02a8de commit 13f50f7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

mmaction/models/backbones/resnet3d.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ class BasicBlock3d(nn.Module):
2424
stride-two layer is the 3x3 conv layer, otherwise the stride-two
2525
layer is the first 1x1 conv layer. Default: 'pytorch'.
2626
inflate (bool): Whether to inflate kernel. Default: True.
27-
inflate_style (str): ``3x1x1`` or ``1x1x1``. which determines the
28-
kernel sizes and padding strides for conv1 and conv2 in each block.
29-
Default: '3x1x1'.
3027
non_local (bool): Determine whether to apply non-local module in this
3128
block. Default: False.
3229
non_local_cfg (dict): Config for non-local module. Default: ``dict()``.
@@ -50,16 +47,17 @@ def __init__(self,
5047
downsample=None,
5148
style='pytorch',
5249
inflate=True,
53-
inflate_style='3x1x1',
5450
non_local=False,
5551
non_local_cfg=dict(),
5652
conv_cfg=dict(type='Conv3d'),
5753
norm_cfg=dict(type='BN3d'),
5854
act_cfg=dict(type='ReLU'),
59-
with_cp=False):
55+
with_cp=False,
56+
**kwargs):
6057
super().__init__()
6158
assert style in ['pytorch', 'caffe']
62-
assert inflate_style in ['3x1x1', '3x3x3']
59+
# make sure that only ``inflate_style`` is passed into kwargs
60+
assert set(kwargs.keys()).issubset(['inflate_style'])
6361

6462
self.inplanes = inplanes
6563
self.planes = planes
@@ -68,7 +66,6 @@ def __init__(self,
6866
self.dilation = dilation
6967
self.style = style
7068
self.inflate = inflate
71-
self.inflate_style = inflate_style
7269
self.conv_cfg = conv_cfg
7370
self.norm_cfg = norm_cfg
7471
self.act_cfg = act_cfg
@@ -166,7 +163,7 @@ class Bottleneck3d(nn.Module):
166163
stride-two layer is the 3x3 conv layer, otherwise the stride-two
167164
layer is the first 1x1 conv layer. Default: 'pytorch'.
168165
inflate (bool): Whether to inflate kernel. Default: True.
169-
inflate_style (str): ``3x1x1`` or ``1x1x1``. which determines the
166+
inflate_style (str): ``3x1x1`` or ``3x3x3``. which determines the
170167
kernel sizes and padding strides for conv1 and conv2 in each block.
171168
Default: '3x1x1'.
172169
non_local (bool): Determine whether to apply non-local module in this

0 commit comments

Comments
 (0)