def TF_shear(x, shear=0.0): assert len(x.shape) == 3 h, w, nc = x.shape # Perform shear xc = warp(x, AffineTransform(shear=shear), mode='edge') return xc