Skip to contents

Prints an array value to the console during execution and returns the input unchanged. This is useful for debugging JIT-compiled code.

Usage

prim_print(x)

Arguments

x

(arrayish)
Arrayish value of any data type.

Value

arrayish
Returns x as-is.

Implemented Rules

  • stablehlo

StableHLO

Lowers to hlo_custom_call().

See also

Examples

x <- nv_array(c(1, 2, 3))
prim_print(x)
#> AnvlArray
#>  1
#>  2
#>  3
#> [ f32{3} ]
#> AnvlArray
#>  1
#>  2
#>  3
#> [ CPUf32{3} ]