pytorch基础 取,索引,维度变化
文章目录type_as取操作index_select(a,dim,indices) 在a 的dim维度上按indices 取索引,indices 一定是tensorge gt eq这种判断大小 返回0,1 且和原shape 相等ge 取mask(保持原shape),masked_select(a,mask),已被展平,只取数值成 tensortake(x,indices) 将x 展平,取indices(tensor)位置值nonzero 返回索引(输入 a*b,nonzero 输出z*)shape 变换vi
复制链接