def temp_testCropping(self):
x_shape = [4, 8, 1]
x_np = np.array([[1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8],
[1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 3, 4, 5, 6, 7, 8]],
dtype=np.int32).reshape(x_shape)
y_np = np.array([[3, 4, 5, 6], [3, 4, 5, 6]]).reshape([2, 4, 1])
with self.test_session():
x = constant_op.constant(x_np, shape=x_shape)
try:
y = image_ops.central_crop(x, 0.5)
except:
import pdb
pdb.post_mortem()
y_tf = y.eval()
self.assertAllEqual(y_tf, y_np)
评论列表
文章目录