随笔分类 - 动手学习深度学习V2
摘要:1 只由一个元素组成的张量称为一维张量 x=torch.tensor([3.0]) y=torch.tensor([2.0]) x+y,x-y,x*y,x/y,x**y (tensor([5.]), tensor([1.]), tensor([6.]), tensor([1.5000]), tens
阅读全文
摘要:数据操作 1.创建12个数的张量 import torch x=torch.arange(12) x tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) x.shape #张量的大小 torch.Size([12]) 2.调用reshape函数可以改变张量
阅读全文

浙公网安备 33010602011771号