Rate this Page
★★★★★
torch.result_type#
- torch.result_type(tensor1,tensor2)→dtype#
Returns the
torch.dtypethat would result from performing an arithmeticoperation on the provided input tensors. See type promotiondocumentationfor more information on the type promotion logic.- Parameters
Example:
>>>torch.result_type(torch.tensor([1,2],dtype=torch.int),1.0)torch.float32>>>torch.result_type(torch.tensor([1,2],dtype=torch.uint8),torch.tensor(1))torch.uint8
On this page