def shrink_tensor(x, w):
 return x[tuple(([slice(w, (- w))] * x.ndim))]

def shrink_tensor ( x , w ) : return x [ tuple ( ( [ slice ( w , ( - w ) ) ] * x . ndim ) ) ]
x : a theano tensortype variable w : a theano integer scalar returns: y: a theano tensortype variable containing all but the borders of x .