numpy/tensorflow打印(显示)全部值

加入np.set_printoptions(threshold=np.inf)即可

import numpy as np
np.set_printoptions(threshold=np.inf)

np.random.seed(1)
arr=np.random.randint(1,9,(14,14))
print(arr)

执行结果:

[[6 4 5 1 8 2 4 6 8 1 1 2 5 8]
 [6 5 7 2 3 5 7 6 3 5 4 5 3 5]
 [6 7 3 5 8 8 2 2 8 7 1 7 6 2]
 [2 8 8 6 7 2 2 1 5 2 1 1 6 4]
 [8 3 2 1 7 8 4 7 6 2 2 4 5 1]
 [2 4 5 3 5 1 6 4 2 3 8 1 5 2]
 [8 3 8 8 3 2 1 7 2 4 8 7 8 6]
 [5 4 6 2 4 7 1 1 3 3 8 8 8 8]
 [2 8 4 5 3 7 7 1 1 8 8 2 2 6]
 [4 1 1 6 6 7 5 6 7 3 5 4 6 4]
 [8 6 1 4 5 4 5 7 5 8 8 6 5 2]
 [1 5 3 1 6 3 8 5 2 8 2 1 3 5]
 [5 1 5 2 7 5 2 1 3 4 2 3 5 5]
 [8 3 3 7 1 2 3 7 7 3 8 8 1 7]]

原文出处:/show_1EF5LMCzxvaT.html