(inputs, tokens, adjmat, downsample=False, name=None)
return x
cell
cell
cell
def cell(inputs, tokens, adjmat, downsample=False, name=None):
    """
        cell
    """
    filters = inputs.shape[1]
    d = filters // FLAGS.ratio

    num_nodes, tensors = len(adjmat), []
    for n in range(num_nodes):
        func = ops[tokens[n]]
        idx, = np.nonzero(adjmat[:, n])
        if len(idx) == 0:
            x = layers.bn_relu(inputs)
            x = layers.conv(x, d, (1, 1))
            x = layers.bn_relu(x)
            x = func(x, downsample)
        else:
            x = fluid.layers.sums([tensors[i] for i in idx])
            x = layers.bn_relu(x)
            x = func(x)
        tensors.append(x)

    free_ends, = np.where(~adjmat.any(axis=1))
    tensors = [tensors[i] for i in free_ends]
    filters = filters * 2 if downsample else filters
    x = fluid.layers.concat(tensors, axis=1)
    x = layers.conv(x, filters, (1, 1))
    return x
def cell ( inputs , tokens , adjmat , downsample = False , name = None ) : filters = inputs . shape [ 1 ] d = filters // FLAGS . ratio num_nodes , tensors = len ( adjmat ) , [ ] for n in range ( num_nodes ) : func = ops [ tokens [ n ] ] idx , = np . nonzero ( adjmat [ : , n ] ) if len ( idx ) == 0 : x = layers . bn_relu ( inputs ) x = layers . conv ( x , d , ( 1 , 1 ) ) x = layers . bn_relu ( x ) x = func ( x , downsample ) else : x = fluid . layers . sums ( [ tensors [ i ] for i in idx ] ) x = layers . bn_relu ( x ) x = func ( x ) tensors . append ( x ) free_ends , = np . where ( ~ adjmat . any ( axis = 1 ) ) tensors = [ tensors [ i ] for i in free_ends ] filters = filters * 2 if downsample else filters x = fluid . layers . concat ( tensors , axis = 1 ) x = layers . conv ( x , filters , ( 1 , 1 ) ) return x