image_ops_test.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:imperative 作者: yaroslavvb 项目源码 文件源码
def testUpDown(self):
    try:
      x_np = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.uint8).reshape([2, 3, 1])
      y_np = np.array([[4, 5, 6], [1, 2, 3]], dtype=np.uint8).reshape([2, 3, 1])

      for use_gpu in [False, True]:
        with self.test_session(use_gpu=use_gpu):
          x_tf = constant_op.constant(x_np, shape=x_np.shape)
          y = image_ops.flip_up_down(x_tf)
          y_tf = y.eval()
          self.assertAllEqual(y_tf, y_np)
    except:
        import sys, pdb, traceback
        type, value, tb = sys.exc_info()
        traceback.print_exc()
        pdb.post_mortem(tb)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号