MCPcopy Create free account
hub / github.com/espnet/espnet / _make_layer

Method _make_layer

espnet2/spk/encoder/resnet_encoder.py:66–74  ·  view source on GitHub ↗
(
        self, block: Type[nn.Module], planes: int, num_blocks: int, stride: int
    )

Source from the content-addressed store, hash-verified

64 self.layer4 = self._make_layer(block, m_channels * 8, num_blocks[3], stride=2)
65
66 def _make_layer(
67 self, block: Type[nn.Module], planes: int, num_blocks: int, stride: int
68 ) -> nn.Sequential:
69 strides = [stride] + [1] * (num_blocks - 1)
70 layers = []
71 for stride in strides:
72 layers.append(block(self.in_planes, planes, stride))
73 self.in_planes = planes * block.expansion
74 return nn.Sequential(*layers)
75
76 def output_size(self) -> int:
77 return self._output_size

Callers 1

__init__Method · 0.95

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected