MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / BatchNorm1dTBC

Class BatchNorm1dTBC

modules/commons/common_layers.py:525–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523
524
525class BatchNorm1dTBC(nn.Module):
526 def __init__(self, c):
527 super(BatchNorm1dTBC, self).__init__()
528 self.bn = nn.BatchNorm1d(c)
529
530 def forward(self, x):
531 """
532
533 :param x: [T, B, C]
534 :return: [T, B, C]
535 """
536 x = x.permute(1, 2, 0) # [B, C, T]
537 x = self.bn(x) # [B, C, T]
538 x = x.permute(2, 0, 1) # [T, B, C]
539 return x
540
541
542class EncSALayer(nn.Module):

Callers 2

__init__Method · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected