一.打印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())
posted on 2023-08-31 22:27  孜孜不倦fly  阅读(127)  评论(0)    收藏  举报