legate::Slice#

class Slice#

A slice descriptor.

Slice behaves similarly to how the slice in Python does, and has different semantics from std::slice.

Public Functions

inline Slice(
std::optional<std::int64_t> _start = OPEN,
std::optional<std::int64_t> _stop = OPEN
)#

Constructs a Slice

If provided (and not Slice::OPEN), _start must compare less than or equal to _stop. Similarly, if provided (and not Slice::OPEN), _stop must compare greater than or equal to_start. Put simply, unless one or both of the ends are unbounded, [_start, _stop] must form a valid (possibly empty) interval.

Parameters:
  • _start – The optional begin index of the slice, or Slice::OPEN if the start of the slice is unbounded.

  • _stop – The optional stop index of the slice, or Slice::OPEN if the end of the slice if unbounded.

Public Members

std::optional<std::int64_t> start = {OPEN}#

The start index of the slice

std::optional<std::int64_t> stop = {OPEN}#

The end index of the slice