Skip to contents

Promote tensors to a common data type, see common_dtype for more details.

Usage

nv_promote_to_common(...)

Arguments

...

(tensorish)
Tensors to promote.

Value

(list() of tensorish)

Examples

jit_eval({
  x <- nv_tensor(1L)
  y <- nv_tensor(1.5)
  # integer is promoted to float
  nv_promote_to_common(x, y)
})
#> [[1]]
#> AnvilTensor
#>  1
#> [ CPUf32{1} ] 
#> 
#> [[2]]
#> AnvilTensor
#>  1.5000
#> [ CPUf32{1} ] 
#>