.squeeze(0)
时间: 2024-05-18 10:11:20 浏览: 123
plugin.audio.squeezebox:Kodi 的 Squeezelite 播放器
.squeeze(0)是一个PyTorch中的函数,用于删除张量的尺寸为1的维度。当我们调用.squeeze(0)时,它会删除第0维的维度,将原本的张量从多维变成高维。这意味着如果原本的张量是一维的,调用.squeeze(0)将没有任何效果。如果原本的张量是2维的,如m*n(其中m和n都大于1),调用.squeeze(0)将删除第0维,使张量从二维变为一维。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [pytorch学习之---squeeze()和unsqueeze()函数功能及使用](https://blog.csdn.net/guihaiyuan123/article/details/113455775)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [pyTorch.randn()、rand()、cat()、pow()、scatter_()、.squeeze() 、.unsqueeze()](https://download.csdn.net/download/weixin_38606656/14884199)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文