import tensorflow as tf


def res_block_bottleneck(x,
                         ksize_list,
                         strides,
                         is_training,
                         data_format='NHWC',
                         w_project=None,
                         no_activation=False):
    """
    Computes y = x + F(x), where F(x) is the residual block function. At downsample layers, applies
    a downsample function on x as well.
    """
    if w_project is not None:
        x_ = tf.conv2d(x, w_project, strides, padding='SAME', data_format=data_format)
    else:
        x_ = x
    return x_ + _bottleneck_residual(
        x,
        ksize_list,
        strides,
        'SAME',
        is_training,
        data_format=data_format,
        no_activation=no_activation)


