会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
IT恶棍
博客园
首页
新随笔
联系
订阅
管理
[置顶]
gather函数
摘要: gather(input, dim, index):根据 index,在 dim 维度上选取数据,输出的 size 与 index 一致 # input (Tensor) – 源张量 # dim (int) – 索引的轴 # index (LongTensor) – 聚合元素的下标(index需要是
阅读全文
posted @ 2020-05-14 12:59 珠江水手
阅读(2213)
评论(0)
推荐(0)
2020年6月5日
元类—metaclass
摘要: 抄过来,帮助学习,防丢失。 原文链接:https://www.cnblogs.com/Simon-xm/p/4034416.html 这是一篇在Stack overflow上 很热的帖子。提问者自称已经掌握了有关Python OOP编程中的各种概念,但始终觉得元类(metaclass)难以理解。他知
阅读全文
posted @ 2020-06-05 15:59 珠江水手
阅读(66)
评论(0)
推荐(0)
2020年5月21日
设置默认tensor类型
摘要: 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)
2020年5月12日
选择函数index_select
摘要: 书中(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)
2020年3月4日
python循环中对一个列表的赋值问题
摘要: 参考:https://www.cnblogs.com/zf-blog/p/10613981.html https://www.cnblogs.com/andywenzhi/p/7453374.html?tdsourcetag=s_pcqq_aiomsg python的赋值方式是数据建立内存单元,将数
阅读全文
posted @ 2020-03-04 15:03 珠江水手
阅读(9703)
评论(0)
推荐(0)
公告