

def repeat_elements(x, rep, axis):
    'Repeats the elements of a tensor along an axis, like np.repeat\n\n    If x has shape (s1, s2, s3) and axis=1, the output\n    will have shape (s1, s2 * rep, s3)\n    '
    x_shape = x.get_shape().as_list()
    splits = tf.split(axis, x_shape[axis], x)
    x_rep = [s for s in splits for i in range(rep)]
    return tf.concat(x_shape, x_rep)

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py repeat_elements/VarMisuse@66/165 `axis`->`x_shape`