donntprune = []
for k, m in enumerate(model.modules()):
if isinstance(m, shortcutLayer):
x = k + m.froms - 8
donntprune.append(x)
x = k - 3
donntprune.append(x)
这段代码的x = k + m.froms - 8,m.froms应该是等于-3,那么x = k + m.froms - 8等价于x = k - 11,是这样吗?也就是当前层之前的倒数第11层,是这样吗?不太明白,望指教
donntprune = [] for k, m in enumerate(model.modules()): if isinstance(m, shortcutLayer): x = k + m.froms - 8 donntprune.append(x) x = k - 3 donntprune.append(x)
这段代码的x = k + m.froms - 8,m.froms应该是等于-3,那么x = k + m.froms - 8等价于x = k - 11,是这样吗?也就是当前层之前的倒数第11层,是这样吗?不太明白,望指教