package nx

  1. Overview
  2. Docs

Module Safetensors.SliceSource

Slicing support for lazy iteration over tensor data

Slice iterator

Sourcetype error = invalid_slice

Indexing specification for a dimension

Sourceval select : int -> index

Select a single index from a dimension

Sourceval (//) : bound -> bound -> index

Create a range slice with start and stop bounds

Sourceval unbounded : bound

Unbounded slice bound

Sourceval included : int -> bound

Inclusive bound

Sourceval excluded : int -> bound

Exclusive bound

Sourceval make : tensor_view -> index list -> (t, error) result

Create a slice iterator from a tensor view and slice specifications

Sourceval next : t -> string option

Get the next chunk of data from the slice iterator

Sourceval remaining_byte_len : t -> int

Get the total number of bytes remaining in the iterator

Sourceval newshape : t -> int list

Get the shape of the sliced tensor