摘要: >>> a = torch.Tensor([[1,2],[3,4]])>>> atensor([[1., 2.], [3., 4.]]) >>> b = torch.Tensor([[7,8],[9,10]])>>> btensor([[ 7., 8.], [ 9., 10.]]) >>> torc 阅读全文
posted @ 2021-01-18 15:47 _八级大狂风 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 常见的Tensor创建方法 1,基础Tensor函数:torch.Tensor(2,2)32位浮点型 2,指定类型: torch.DoubleTensor(2,2)64位浮点型 3,使用python的列表序列:torch.Tensor([[1,2],[3,4]]) 4,默认值为0 :torch.ze 阅读全文
posted @ 2021-01-18 15:12 _八级大狂风 阅读(1320) 评论(0) 推荐(0) 编辑
摘要: (pytorch_gpu) D:\pytorch-text>pythonPython 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32Type "help", " 阅读全文
posted @ 2021-01-18 14:42 _八级大狂风 阅读(180) 评论(0) 推荐(0) 编辑