def __init__(self, num_nodes, channels, prev_channels, prev_prev_channels, reduction, prev_reduction, act_cfg=dict(type='ReLU'), norm_cfg=dict(type='BN')):
    super().__init__()
    self.act_cfg = act_cfg
    self.norm_cfg = norm_cfg
    self.reduction = reduction
    self.num_nodes = num_nodes
    if prev_reduction:
        self.preproc0 = FactorizedReduce(prev_prev_channels, channels, self.act_cfg, self.norm_cfg)
    else:
        self.preproc0 = StandardConv(prev_prev_channels, channels, 1, 1, 0, self.act_cfg, self.norm_cfg)
    self.preproc1 = StandardConv(prev_channels, channels, 1, 1, 0, self.act_cfg, self.norm_cfg)
    self.nodes = nn.ModuleList()
    for depth in range(2, (self.num_nodes + 2)):
        if reduction:
            node_id = f'reduce_n{depth}'
            num_downsample_nodes = 2
        else:
            node_id = f'normal_n{depth}'
            num_downsample_nodes = 0
        self.nodes.append(Node(node_id, depth, channels, num_downsample_nodes))
def __init__(self, num_nodes, channels, prev_channels, prev_prev_channels, reduction, prev_reduction, act_cfg=dict(type='ReLU'), norm_cfg=dict(type='BN')):
    super().__init__()
    self.act_cfg = act_cfg
    self.norm_cfg = norm_cfg
    self.reduction = reduction
    self.num_nodes = num_nodes
    if prev_reduction:
        self.preproc0 = FactorizedReduce(prev_prev_channels, channels, self.act_cfg, self.norm_cfg)
    else:
        self.preproc0 = StandardConv(prev_prev_channels, channels, 1, 1, 0, self.act_cfg, self.norm_cfg)
    self.preproc1 = StandardConv(prev_channels, channels, 1, 1, 0, self.act_cfg, self.norm_cfg)
    self.nodes = nn.ModuleList()
    for depth in range(2, (self.num_nodes + 2)):
        if reduction:
            node_id = f'reduce_n{depth}'
            num_downsample_nodes = 2
        else:
            node_id = f'normal_n{depth}'
            num_downsample_nodes = 0
        self.nodes.append(Node(node_id, depth, channels, num_downsample_nodes))