Skip to main content

Module slice_view

Module slice_view 

Source
Expand description

TensorSliceView — zero-copy logical views into tensor data via offset+stride descriptors, supporting slicing, broadcasting, and element access without data duplication.

§Overview

A TensorSliceView holds a flat Vec<f64> as the backing store and a ViewDescriptor that describes the logical shape, strides, and starting offset into that store. All slice and broadcast operations return new descriptors that share the same flat buffer – no data is ever copied.

§Key types

TypePurpose
SliceRangeA half-open [start, stop) range with a step
ViewDescriptorOffset + shape + strides descriptor for a view
BroadcastShapeNumPy-style broadcast compatibility and stride computation
SliceViewStatsCumulative counters for views, slices, and broadcasts
TensorSliceViewThe main manager that owns the data and exposes the API

Structs§

BroadcastShape
NumPy-style broadcast compatibility checker and stride generator.
SliceRange
A half-open range [start, stop) with a positive step.
SliceViewStats
Cumulative statistics for a TensorSliceView.
TensorSliceView
Zero-copy logical view manager over a flat f64 data buffer.
ViewDescriptor
Describes a logical view into a flat buffer via an offset, shape, and strides.