Creates a 1-D array with values from start to end (inclusive).
Without steps, behaves like R's seq(start, end) producing integer values.
With steps, produces steps evenly spaced values (like seq(start, end, length.out = steps)).
nv_seq_like() is a variant where dtype, ambiguous, and device
default to those of like.
Usage
nv_seq(
start,
end,
steps = NULL,
dtype = NULL,
ambiguous = FALSE,
device = NULL
)
nv_seq_like(
like,
start,
end,
steps = NULL,
dtype = NULL,
ambiguous = NULL,
device = NULL
)Arguments
- start, end
(
numeric(1))
Start and end values. WhenstepsisNULL, must satisfystart <= end.- steps
(
integer(1)orNULL)
Number of evenly spaced values to generate. Must be at least 1. WhenNULL(default), generates consecutive integer values fromstarttoend.- dtype
(
character(1))
Data type. Default"i32"whenstepsisNULL,"f32"whenstepsis given. Fornv_seq_like(),NULLusesdtype(like).- 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 thevignette("type-promotion")for more details.- device
(
character(1)|PJRTDevice|quickr_device|NULL)
Device for data to live on.- like
(
AnvlArray)
Existing array whose attributes are used as defaults (only fornv_seq_like()).
Value
arrayish
1-D array of length end - start + 1.