Skip to main content
Log in

Mojo struct

SymbolicSlice

struct SymbolicSlice

Slice-like struct with Symbol fields.

This struct enables the range slice (start:stop:end) operator with Symbol indices.

Fields

  • start (Optional[Symbol]): The slice's start index.
  • stop (Optional[Symbol]): The slice's start index, exclusive.
  • step (Optional[Symbol]): The slice's step.

Implemented traits

AnyType, CollectionElement, Copyable, Movable, UnknownDestructibility

Methods

__init__

__init__(out self, start: Optional[Symbol], stop: Optional[Symbol])

Convenience constructor from start and step that doesn't require step.

__init__(out self, g: Graph, s: Slice)

Convenience constructor from a Slice.

This wraps any indices in s into constant nodes (using mo.constant).

Args:

  • g (Graph): The Graph into which the constant nodes are created.
  • s (Slice): The Slice to turn into SymbolicSlice.