def __init__(self, c_dim, size_in, size_h=None, size_out=None, norm_method='batch_norm', legacy=False):
    super().__init__()
    if (size_h is None):
        size_h = size_in
    if (size_out is None):
        size_out = size_in
    self.size_in = size_in
    self.size_h = size_h
    self.size_out = size_out
    if (not legacy):
        self.bn_0 = CBatchNorm1d(c_dim, size_in, norm_method=norm_method)
        self.bn_1 = CBatchNorm1d(c_dim, size_h, norm_method=norm_method)
    else:
        self.bn_0 = CBatchNorm1d_legacy(c_dim, size_in, norm_method=norm_method)
        self.bn_1 = CBatchNorm1d_legacy(c_dim, size_h, norm_method=norm_method)
    self.fc_0 = nn.Conv1d(size_in, size_h, 1)
    self.fc_1 = nn.Conv1d(size_h, size_out, 1)
    self.actvn = nn.ReLU()
    if (size_in == size_out):
        self.shortcut = None
    else:
        self.shortcut = nn.Conv1d(size_in, size_out, 1, bias=False)
    nn.init.zeros_(self.fc_1.weight)
def __init__(self, c_dim, size_in, size_h=None, size_out=None, norm_method='batch_norm', legacy=False):
    super().__init__()
    if (size_h is None):
        size_h = size_in
    if (size_out is None):
        size_out = size_in
    self.size_in = size_in
    self.size_h = size_h
    self.size_out = size_out
    if (not legacy):
        self.bn_0 = CBatchNorm1d(c_dim, size_in, norm_method=norm_method)
        self.bn_1 = CBatchNorm1d(c_dim, size_h, norm_method=norm_method)
    else:
        self.bn_0 = CBatchNorm1d_legacy(c_dim, size_in, norm_method=norm_method)
        self.bn_1 = CBatchNorm1d_legacy(c_dim, size_h, norm_method=norm_method)
    self.fc_0 = nn.Conv1d(size_in, size_h, 1)
    self.fc_1 = nn.Conv1d(size_h, size_out, 1)
    self.actvn = nn.ReLU()
    if (size_in == size_out):
        self.shortcut = None
    else:
        self.shortcut = nn.Conv1d(size_in, size_out, 1, bias=False)
    nn.init.zeros_(self.fc_1.weight)