Skip to contents

Creates an array with values increasing along the specified dimension.

Usage

prim_iota(dim, dtype, shape, start = 1L, ambiguous = FALSE, device = NULL)

Arguments

dim

(integer(1))
Dimension along which values increase (1-indexed).

dtype

(character(1) | tengen::DataType)
Data type.

shape

(integer())
Shape of the output array.

start

(integer(1))
Starting value.

ambiguous

(logical(1))
Whether the type is ambiguous. Ambiguous types usually arise from R literals (e.g., 1L, 1.0) and follow special promotion rules. See the vignette("type-promotion") for more details.

device

( character(1) | PJRTDevice | quickr_device | NULL)
Device for data to live on.

Value

arrayish
Has the given dtype and shape.

Implemented Rules

  • stablehlo

  • quickr

StableHLO

Lowers to stablehlo::hlo_iota().

See also

Examples

prim_iota(dim = 1L, dtype = "i32", shape = 5L)
#> AnvlArray
#>  1
#>  2
#>  3
#>  4
#>  5
#> [ CPUi32{5} ]