pytorch中张量
时间: 2023-10-21 22:55:57 浏览: 96
在PyTorch中,张量是一种多维数组,可以用来存储和操作数据。张量有不同的维度,可以通过torch.view()和torch.reshape()方法进行维度变换。例如,使用torch.view()可以将一个4x4的张量x变换为一个大小为16的一维张量y,或者将x变换为一个2x8的张量z,其中-1表示这个维度的大小由其他维度决定。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [【PyTorch】PyTorch基础知识——张量](https://blog.csdn.net/qq_42251120/article/details/126835591)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [pytorch基础:张量](https://blog.csdn.net/m0_56253030/article/details/126374600)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文