def asymmetric_temporal_padding(x, left_pad=1, right_pad=1):
 input_shape = x.shape
 output_shape = (input_shape[0], ((input_shape[1] + left_pad) + right_pad), input_shape[2])
 output = T.zeros(output_shape)
 return T.set_subtensor(output[:, left_pad:(x.shape[1] + left_pad), :], x)

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