随笔分类 -  pytorch

关于深度学习框架pytorch的问题
摘要:python版本:Python 3.8.2 pytorch版本:1.5.0+cpu import torch torch.set_default_tensor_type('torch.IntTensor') # tensor 类型设置默认类型语句:输入为字符:' ' 报错: Traceback (m 阅读全文
posted @ 2020-05-21 09:47 珠江水手 阅读(1212) 评论(1) 推荐(0)
摘要:gather(input, dim, index):根据 index,在 dim 维度上选取数据,输出的 size 与 index 一致 # input (Tensor) – 源张量 # dim (int) – 索引的轴 # index (LongTensor) – 聚合元素的下标(index需要是 阅读全文
posted @ 2020-05-14 12:59 珠江水手 阅读(2218) 评论(0) 推荐(0)
摘要:书中(pytorch入门实战)讲:index_select(input, dim, index),指定维度dim上选取,未有示例。 查到相关资料后, import torch as t # 导入torch模块c = t.randn(3, 6) # 定义tensorprint(c)b = t.inde 阅读全文
posted @ 2020-05-12 11:22 珠江水手 阅读(1299) 评论(0) 推荐(1)