def temporal_padding(x, padding=1):
    pattern = [[0, 0], [padding, padding], [0, 0]]
    return tf.pad(x, pattern)
Pads the middle dimension of a 3D tensor
dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py/temporal_padding