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(operand)

Arguments

operand

(arrayish)
Arrayish value of any data type.

Value

arrayish
Returns operand as-is.

Implemented Rules

  • stablehlo

StableHLO

Lowers to stablehlo::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} ]