def __init__(self, in_channels, base_channels, num_layers=8, num_nodes=4, stem_multiplier=3, out_indices=(7,), auxliary=False, aux_channels=None, aux_out_channels=None, act_cfg=dict(type='ReLU'), norm_cfg=dict(type='BN')):
    super().__init__()
    self.in_channels = in_channels
    self.base_channels = base_channels
    self.num_layers = num_layers
    self.num_nodes = num_nodes
    self.stem_multiplier = stem_multiplier
    self.out_indices = out_indices
    assert (self.out_indices[(- 1)] == (self.num_layers - 1))
    if auxliary:
        assert (aux_channels is not None)
        assert (aux_out_channels is not None)
        self.aux_channels = aux_channels
        self.aux_out_channels = aux_out_channels
        self.auxliary_indice = ((2 * self.num_layers) // 3)
    else:
        self.auxliary_indice = (- 1)
    self.norm_cfg = norm_cfg
    self.act_cfg = act_cfg
    self.out_channels = (self.stem_multiplier * self.base_channels)
    stem_norm_cfg = copy.deepcopy(self.norm_cfg)
    stem_norm_cfg.update(dict(affine=True))
    self.stem = nn.Sequential(nn.Conv2d(self.in_channels, self.out_channels, 3, 1, 1, bias=False), build_norm_layer(self.norm_cfg, self.out_channels)[1])
    prev_prev_channels = self.out_channels
    prev_channels = self.out_channels
    self.out_channels = self.base_channels
    self.cells = nn.ModuleList()
    (prev_reduction, reduction) = (False, False)
    for i in range(self.num_layers):
        (prev_reduction, reduction) = (reduction, False)
        if ((i == (self.num_layers // 3)) or (i == ((2 * self.num_layers) // 3))):
            self.out_channels *= 2
            reduction = True
        cell = Cell(self.num_nodes, self.out_channels, prev_channels, prev_prev_channels, reduction, prev_reduction, self.act_cfg, self.norm_cfg)
        self.cells.append(cell)
        prev_prev_channels = prev_channels
        prev_channels = (self.out_channels * self.num_nodes)
        if (i == self.auxliary_indice):
            self.auxliary_module = AuxiliaryModule(prev_channels, self.aux_channels, self.aux_out_channels, self.norm_cfg)
def __init__(self, in_channels, base_channels, num_layers=8, num_nodes=4, stem_multiplier=3, out_indices=(7,), auxliary=False, aux_channels=None, aux_out_channels=None, act_cfg=dict(type='ReLU'), norm_cfg=dict(type='BN')):
    super().__init__()
    self.in_channels = in_channels
    self.base_channels = base_channels
    self.num_layers = num_layers
    self.num_nodes = num_nodes
    self.stem_multiplier = stem_multiplier
    self.out_indices = out_indices
    assert (self.out_indices[(- 1)] == (self.num_layers - 1))
    if auxliary:
        assert (aux_channels is not None)
        assert (aux_out_channels is not None)
        self.aux_channels = aux_channels
        self.aux_out_channels = aux_out_channels
        self.auxliary_indice = ((2 * self.num_layers) // 3)
    else:
        self.auxliary_indice = (- 1)
    self.norm_cfg = norm_cfg
    self.act_cfg = act_cfg
    self.out_channels = (self.stem_multiplier * self.base_channels)
    stem_norm_cfg = copy.deepcopy(self.norm_cfg)
    stem_norm_cfg.update(dict(affine=True))
    self.stem = nn.Sequential(nn.Conv2d(self.in_channels, self.out_channels, 3, 1, 1, bias=False), build_norm_layer(self.norm_cfg, self.out_channels)[1])
    prev_prev_channels = self.out_channels
    prev_channels = self.out_channels
    self.out_channels = self.base_channels
    self.cells = nn.ModuleList()
    (prev_reduction, reduction) = (False, False)
    for i in range(self.num_layers):
        (prev_reduction, reduction) = (reduction, False)
        if ((i == (self.num_layers // 3)) or (i == ((2 * self.num_layers) // 3))):
            self.out_channels *= 2
            reduction = True
        cell = Cell(self.num_nodes, self.out_channels, prev_channels, prev_prev_channels, reduction, prev_reduction, self.act_cfg, self.norm_cfg)
        self.cells.append(cell)
        prev_prev_channels = prev_channels
        prev_channels = (self.out_channels * self.num_nodes)
        if (i == self.auxliary_indice):
            self.auxliary_module = AuxiliaryModule(prev_channels, self.aux_channels, self.aux_out_channels, self.norm_cfg)