快捷方式

torch.promote_types

torch.promote_types(type1, type2) dtype

返回 torch.dtype,該 dtype 具有最小的尺寸和標量型別,且不小於或不低於 type1type2 中的任何一個。有關型別提升邏輯的更多資訊,請參閱型別提升 文件

引數

示例

>>> torch.promote_types(torch.int32, torch.float32)
torch.float32
>>> torch.promote_types(torch.uint8, torch.long)
torch.long

文件

查閱 PyTorch 全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源