问题:当数组/矩阵过大则只会显示其中一部分,中间会自动用省略号代替:
import numpy as np
matrix = np.zeros((100,100), dtype = np.int)
print(matrix)
解决:通过set_printoptions()设定显示全部
import numpy as np
import torch
torch.set_printoptions(profile="full")
np.set_printoptions(threshold=np.inf)
matrix = np.zeros((100,100), dtype = np.int)
print(matrix)
tensor_mat = torch.zeros((100,100), dtype = torch.int)
print(tensor_mat)