提交 be83d6ae 编写于 作者: W weishengyu

use dict instead of list

上级 4e5b60c0
......@@ -79,8 +79,8 @@ class Layer1(TheseusLayer):
def __init__(self, num_channels, has_se=False, name=None):
super(Layer1, self).__init__()
self.bottleneck_block_list = nn.Sequential(*[
BottleneckBlock(
self.bottleneck_block_list = nn.Sequential(*{
"bb_{}_{}".format(name, i + 1): BottleneckBlock(
num_channels=num_channels if i == 0 else 256,
num_filters=64,
has_se=has_se,
......@@ -88,7 +88,7 @@ class Layer1(TheseusLayer):
downsample=True if i == 0 else False,
name=name + '_' + str(i + 1))
for i in range(4)
])
})
def forward(self, x, res_dict=None):
y = x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册