上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: ![](https://img2024.cnblogs.com/blog/369406/202503/369406-20250321145425450-2100938034.png) 阅读全文
posted @ 2025-03-21 14:54 xiezhengcai 阅读(33) 评论(0) 推荐(0)
摘要: 多个张量堆叠的时候,将张量理解为索引(树)形状。然后将每个张量想象成纸张一样,从下往上的堆叠,然后再根据所在的维度将其合并,即得到堆叠后的张量 阅读全文
posted @ 2025-03-16 19:58 xiezhengcai 阅读(15) 评论(0) 推荐(0)
摘要: 沿着某个维度操作,即压缩指定的维度,而其它维度保持不变 In [3]: import torch from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = 阅读全文
posted @ 2025-03-16 11:35 xiezhengcai 阅读(31) 评论(0) 推荐(0)
摘要: sum 函数有两个定义: torch.sum(input, *, dtype=None) → Tensor torch.sum(input, dim, keepdim=False, *, dtype=None) → Tensor ** sum 函数本质上是对张量自身做自加操作,只是它可以定义,在不同 阅读全文
posted @ 2025-03-15 12:45 xiezhengcai 阅读(125) 评论(0) 推荐(0)
摘要: 高纬张量显示报错: table data could not be loaded error occurred: pydev_val 2 pydev_val _jb_get_info_command got exception: Must pass 2-d inp setting -> Langua 阅读全文
posted @ 2025-03-15 11:39 xiezhengcai 阅读(72) 评论(0) 推荐(0)
摘要: 基础操作¶ In [16]: import torch from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" # 目标张量 (shape: 阅读全文
posted @ 2025-03-14 18:53 xiezhengcai 阅读(94) 评论(0) 推荐(0)
摘要: 返回一个原始张量交换后的视图¶ torch.permute(input, dims) → Tensor permute() 返回的是原张量的视图(view),与原张量共享内存。 transpose(dim0, dim1) 只能交换两个维度,而 permute() 可以处理多个维度。 执行 trans 阅读全文
posted @ 2025-03-14 17:34 xiezhengcai 阅读(235) 评论(0) 推荐(0)
摘要: In [23]: from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" import torch.nn.functional as F im 阅读全文
posted @ 2025-03-14 17:17 xiezhengcai 阅读(193) 评论(0) 推荐(0)
摘要: Pytorch 中topk的用法¶ In [14]: import torch from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" a = 阅读全文
posted @ 2025-03-14 16:49 xiezhengcai 阅读(113) 评论(0) 推荐(0)
摘要: 线性变换即等于与权重矩阵的相乘 阅读全文
posted @ 2025-03-14 13:12 xiezhengcai 阅读(25) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 12 下一页