import tensorflow as tf


        layers.append((X, w, h, comb_ch))

    def _combine_cell_blocks(self, cell_inputs, blocks, cell_arch, w, h, block_ch, is_train=False):
        # Count usage of inputs
        input_use_counts = [0] * len(cell_inputs + blocks)
        for (idx1, _, idx2, _) in cell_arch:
            input_use_counts[idx1] += 1
            input_use_counts[idx2] += 1

        # Concat only unused blocks
        with tf.variable_scope('combine'):
            block_use_counts = input_use_counts[len(cell_inputs):]
            out_blocks = [block for (block, use_count) in zip(blocks, block_use_counts) if use_count == 0]
            comb_ch = len(out_blocks) * block_ch
            X = tf.concat(out_blocks, axis=3)

        return (X, comb_ch)

    def _combine_cell_blocks_dynamic(self, cell_inputs, blocks, cell_arch, w, h, block_ch, is_train=False):
        ni = len(cell_inputs + blocks)
        b = len(blocks)

        # Count usage of inputs
        block_uses = []
        for bi in range(b):
            idx1 = cell_arch[bi][0]
            idx2 = cell_arch[bi][2]
            block_use = tf.one_hot(idx1, ni, dtype=tf.int32) + tf.one_hot(idx2, ni, dtype=tf.int32)
            block_uses.append(block_use)
