Rate this Page

torch.promote_types#

torch.promote_types(type1,type2)dtype#

Returns thetorch.dtype with 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

Example:

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