TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.result_type

tensorplay.functional.result_type(tensor1, tensor2) → dtype[source]

Returns the tensorplay.dtype that would result from performing an arithmetic operation on the provided input tensors. See type promotion documentation for more information on the type promotion logic.

Parameters:
  • tensor1 (Tensor or Number) – an input tensor or number

  • tensor2 (Tensor or Number) – an input tensor or number

Example:

>>> tensorplay.result_type(tensorplay.tensor([1, 2], dtype=tensorplay.int), 1.0)
tensorplay.float32
>>> tensorplay.result_type(tensorplay.tensor([1, 2], dtype=tensorplay.uint8), tensorplay.tensor(1))
tensorplay.uint8

On this page

Ask DeepWiki