Rate this Page
★★★★★
torch.promote_types#
- torch.promote_types(type1,type2)→dtype#
Returns the
torch.dtypewith the smallest size and scalar kind that isnot smaller nor of lower kind than eithertype1 ortype2. See type promotiondocumentation for more information on the typepromotion logic.- Parameters
type1 (
torch.dtype) –type2 (
torch.dtype) –
Example:
>>>torch.promote_types(torch.int32,torch.float32)torch.float32>>>torch.promote_types(torch.uint8,torch.long)torch.long
On this page