Range

data class Range<T : DType, V>(val start: Int, val end: Int) : Slice<T, V> (source)

Represents a contiguous range slice [start, end).

Range slices select a continuous sequence of elements along a dimension, similar to Python's tensor[start:end] notation. This is the most common and performance-friendly slice type.

Characteristics

  • Always contiguous in memory

  • Enables vectorized operations

  • Efficient for batch processing

  • Natural stride pattern (stride = 1)

Parameters

start

the starting index (inclusive)

end

the ending index (exclusive)

Constructors

Link copied to clipboard
constructor(start: Int, end: Int)

Properties

Link copied to clipboard
val end: Int
Link copied to clipboard
val start: Int