原文:UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

內部實則是bool。 原: 可以看出,實則idxs內部為bool性質。 改后: ...

2020-05-06 16:37 0 2017 推薦指數:

查看詳情

Pytorch中的掩碼:dtype=torch.uint8

在pytorch中,dtype=uint8的數據類型往往可以用作掩碼,0表示舍棄對應項,1表示選取對應項。通過設置不同的0或1的值,對另外的tensor進行選擇性選取: 例如: ...

Mon Dec 06 04:07:00 CST 2021 0 797
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM