一.打印np数组
import numpy as np arr = np.array([13, 2500]) print(np.shape(arr))
二.打印tensor张量
import torch arr = torch.Tensor([[1, 2, 3], [4, 5, 6]]) print(arr.shape) #另一种方法 arr = torch.Tensor([[1, 2, 3], [4, 5, 6]]) print(arr.size())