- RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
- Tensor的降维和升维
- 降维:torch.squeeze(tensor,dim=2),dim=2是shape为1的维度,不指定dim就是所有维度中shape为1即降维
- 升维:tensor.unsqueeze(0),在0维度升维,一般是在配合网络的shape时使用;
- reference
- RuntimeError: zero-dimensional tensor (at position 0) cannot be concatenated
- 多个Tensor如何实现类似于list的append
- 创建各种类型的Tensor
- Tensor求绝对值
- Tensor求各元素之和
- data.sum()
- RuntimeError: expected device cuda:0 and dtype Float but got device cpu and dtype Float
- 原因是cpu和gpu模式混用,一般是统一成gpu格式
- 用 index(格式为tensor)抽取另一个tensor中的元素
- tensor.floor、ceil、round、trunc、frac运算
- Pytorch中的交叉熵函数与手动实现
- TypeError: can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory
- Tensor某一维度求和
Pytorch 常见问题总结
于 2022-08-10 09:20:46 首次发布