@@ -430,18 +430,7 @@ def test_tensor_str(self):
430
430
paddle .set_printoptions (4 , 100 , 3 )
431
431
a_str = str (a )
432
432
433
- if six .PY2 :
434
- expected = '''Tensor(shape=[10L, 20L], dtype=float32, place=CPUPlace, stop_gradient=True,
435
- [[0.2727, 0.5489, 0.8655, ..., 0.2916, 0.8525, 0.9000],
436
- [0.3806, 0.8996, 0.0928, ..., 0.9535, 0.8378, 0.6409],
437
- [0.1484, 0.4038, 0.8294, ..., 0.0148, 0.6520, 0.4250],
438
- ...,
439
- [0.3426, 0.1909, 0.7240, ..., 0.4218, 0.2676, 0.5679],
440
- [0.5561, 0.2081, 0.0676, ..., 0.9778, 0.3302, 0.9559],
441
- [0.2665, 0.8483, 0.5389, ..., 0.4956, 0.6862, 0.9178]])'''
442
-
443
- else :
444
- expected = '''Tensor(shape=[10, 20], dtype=float32, place=CPUPlace, stop_gradient=True,
433
+ expected = '''Tensor(shape=[10, 20], dtype=float32, place=CPUPlace, stop_gradient=True,
445
434
[[0.2727, 0.5489, 0.8655, ..., 0.2916, 0.8525, 0.9000],
446
435
[0.3806, 0.8996, 0.0928, ..., 0.9535, 0.8378, 0.6409],
447
436
[0.1484, 0.4038, 0.8294, ..., 0.0148, 0.6520, 0.4250],
@@ -458,12 +447,7 @@ def test_tensor_str2(self):
458
447
a = paddle .to_tensor ([[1.5111111 , 1.0 ], [0 , 0 ]])
459
448
a_str = str (a )
460
449
461
- if six .PY2 :
462
- expected = '''Tensor(shape=[2L, 2L], dtype=float32, place=CPUPlace, stop_gradient=True,
463
- [[1.5111, 1. ],
464
- [0. , 0. ]])'''
465
- else :
466
- expected = '''Tensor(shape=[2, 2], dtype=float32, place=CPUPlace, stop_gradient=True,
450
+ expected = '''Tensor(shape=[2, 2], dtype=float32, place=CPUPlace, stop_gradient=True,
467
451
[[1.5111, 1. ],
468
452
[0. , 0. ]])'''
469
453
@@ -475,12 +459,7 @@ def test_tensor_str3(self):
475
459
a = paddle .to_tensor ([[- 1.5111111 , 1.0 ], [0 , - 0.5 ]])
476
460
a_str = str (a )
477
461
478
- if six .PY2 :
479
- expected = '''Tensor(shape=[2L, 2L], dtype=float32, place=CPUPlace, stop_gradient=True,
480
- [[-1.5111, 1. ],
481
- [ 0. , -0.5000]])'''
482
- else :
483
- expected = '''Tensor(shape=[2, 2], dtype=float32, place=CPUPlace, stop_gradient=True,
462
+ expected = '''Tensor(shape=[2, 2], dtype=float32, place=CPUPlace, stop_gradient=True,
484
463
[[-1.5111, 1. ],
485
464
[ 0. , -0.5000]])'''
486
465
0 commit comments