def temporal_padding(x, padding=1):
 input_shape = x.shape
 output_shape = (input_shape[0], (input_shape[1] + (2 * padding)), input_shape[2])
 output = T.zeros(output_shape)
 return T.set_subtensor(output[:, padding:(x.shape[1] + padding), :], x)

def temporal_padding ( x , padding = 1 ) : input_shape = x . shape output_shape = ( input_shape [ 0 ] , ( input_shape [ 1 ] + ( 2 * padding ) ) , input_shape [ 2 ] ) output = T . zeros ( output_shape ) return T . set_subtensor ( output [ : , padding : ( x . shape [ 1 ] + padding ) , : ] , x )
pads the middle dimension of a 3d tensor with "padding" zeros left and right .