tensor_tiled_view.bend checks
raw source on the hub · import stelliferous@0.0.4.0/tensor_tiled_view.bend as Tensor_tiled_view
Gathers of tiled tensors. A view of the logical shape reads the cells when one target axis reads the lane axis forward one index a step from a group boundary, every other target axis repeats or steps whole cells along one axis, and no axis runs past its extent: the cells move once through the view of the cells, the groups innermost, and every piece sets the lanes past the extent of the result to +0. A view that reads every cell in order keeps the cells. A view that does not keep the lanes of the input keeps them on the axis it reads at the lane axis of its target, or else on the longest axis it keeps whole, and the input takes its lanes there. A view that keeps no axis whole reads the input with its lanes on the unit axis after the last, one lane a cell.
9 imports
import Base import ./kernel_tile.bend as Tile import ./tensor.bend as Tensors import ./tensor_grid.bend as Grid import ./tensor_tasks.bend as Tasks import ./tensor_shape.bend as Shapes import ./tensor_view.bend as Views import ./tensor_tiled.bend as Tiled import ./tensor_tiled_map.bend as TiledMap
Types
type Lanes source · line 26 · raw
Data
The lanes of an input: their axis and its extent, the elements after it, the cells of one group and where the groups lie.
Lanes@axis:Nat -> @extent:U32 -> @inner:U32 -> @outer:U32 -> @position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> Lanes
type Reading source · line 61 · raw
Data
How one target axis reads the input: it repeats one index, it reads the lane axis one index a step, it steps whole cells along a source axis, or it does not read the cells.
RepeatedReading
LaneReading
Stepping@axis:U32 -> @step:U32 -> @cells:U32 -> Reading
UnkeptReading
type Mapped source · line 94 · raw
Data
The target axes of a view read on the cells: whether every axis keeps the cells, the target axis that reads the lanes and its extent, the view of the cells on the other axes with their flags, and the reach of the view.
Mapped@valid:Bool -> @lane:Maybe<&2, Nat> -> @lane_extent:U32 -> @axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @flags:List<&2, Bool> -> @reach:List<&2, U32> -> Mapped
type Gathering source · line 163 · raw
Data
What a gather on the cells reads beside the mapped axes: its name, the offset of the view, the input extents and the lanes of the input.
Gathering@name:String -> @axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @offset:U32 -> @reversed:List<&2, Bool> -> @shape:List<&2, U32> -> @target:List<&2, U32> -> Gathering
Definitions
def lanes_around source · line 29 · raw
@around:Maybe<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Around> -> @+axis:Nat -> @+position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> Lanes
def lanes_of source · line 36 · raw
@+shape:List<&2, U32> -> @+axis:Nat -> @+position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> Lanes
def lane_axis source · line 39 · raw
@lanes:Lanes -> Nat
def lane_inner source · line 43 · raw
@lanes:Lanes -> U32
def cell_at source · line 47 · raw
@position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> @+outer_index:U32 -> @+group:U32 -> @+groups:U32 -> @+outer:U32 -> U32
def cell_index source · line 54 · raw
@+lanes:Lanes -> @+index:U32 -> U32
The cell of the logical element at index, or the cell step of a logical stride that reads whole cells.
def lane_reading source · line 67 · raw
@+step:U32 -> @+stride:U32 -> @+lanes:Lanes -> @+axis:U32 -> Reading
def reading_of source · line 70 · raw
@found:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Stepped -> @+stride:U32 -> @+lanes:Lanes -> Reading
def classified source · line 76 · raw
@+shape:List<&2, U32> -> @+lanes:Lanes -> @+extent:U32 -> @+stride:U32 -> Reading
def raised source · line 80 · raw
@reach:List<&2, U32> -> @axis:Nat -> @+amount:U32 -> List<&2, U32>
The highest index of every source axis a view reaches.
def all_inside source · line 86 · raw
@reach:List<&2, U32> -> @shape:List<&2, U32> -> Bool
def with_reading source · line 97 · raw
@reading:Reading -> @+reversed:Bool -> @+index:Nat -> @+extent:U32 -> @+lane_axis:Nat -> @mapped:Mapped -> Mapped
def mapped_axes source · line 112 · raw
@axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+index:Nat -> @+shape:List<&2, U32> -> @+lanes:Lanes -> @+start:List<&2, U32> -> Mapped
def moved_view source · line 124 · raw
@+name:String -> @+axis:Nat -> @+lane_extent:U32 -> @+cell_axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+offset:U32 -> @cells:0xa2af805348d03b11eb853850859654f6/tensor.Tensor<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
The cells moved through the view of the cells, the other target axes then the groups of the lane axis of the target, every piece setting the lanes past the extent of the result to +0 as it is filled.
def none_flagged source · line 128 · raw
@flags:List<&2, Bool> -> Bool
def in_order source · line 136 · raw
@status:0xa2af805348d03b11eb853850859654f6/tensor.Status -> @+cell_axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+offset:U32 -> @+lanes:U32 -> @+lane_extent:U32 -> @+source:List<&2, U32> -> Bool
A usable input whose view of the cells reads every cell in order from the first, keeping the lane extent, keeps its cells: the lanes past the extent are +0 already.
def moved_or_kept source · line 141 · raw
@kept:Bool -> @+name:String -> @+axis:Nat -> @+lane_extent:U32 -> @+cell_axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+offset:U32 -> @cells:0xa2af805348d03b11eb853850859654f6/tensor.Tensor<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def moved_cells source · line 147 · raw
@+name:String -> @+axis:Nat -> @+lane_extent:U32 -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+offset:U32 -> @+group_step:U32 -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def coordinate_at source · line 155 · raw
@coordinates:List<&2, U32> -> @axis:Nat -> U32
The first index of the view along the lane axis.
def gathered_lane source · line 166 · raw
@lane:Maybe<&2, Nat> -> @+name:String -> @+offset:U32 -> @+lanes:Lanes -> @+lane_extent:U32 -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather_kept source · line 173 · raw
@mapped:Mapped -> @+name:String -> @+offset:U32 -> @+lanes:Lanes -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather_at source · line 179 · raw
@+name:String -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+shape:List<&2, U32> -> @+lanes:Lanes -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
The gather with the lanes of the input on the axis of lanes, which the view keeps.
def mapped_keeps source · line 183 · raw
@mapped:Mapped -> @+shape:List<&2, U32> -> @+first:U32 -> Bool
def keeps source · line 190 · raw
@+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+shape:List<&2, U32> -> @+lanes:Lanes -> Bool
The view keeps the lanes on their axis: one target axis reads it one index a step from a group boundary, every other target axis repeats or steps whole cells, and the view stays inside the input.
def kept_among source · line 195 · raw
@axes:List<&2, Nat> -> @+context:Gathering -> @+position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> Maybe<&2, Nat>
The first of the axes whose lanes the view keeps.
def gather_values source · line 207 · raw
@+context:Gathering -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
The view keeps no axis whole: the input takes its lanes on its unit axis, one value a cell in the logical shape, the view reads the cells as they are and the result keeps the lanes on the unit axis of the target.
def reading source · line 215 · raw
@shape:List<&2, U32> -> @+index:Nat -> @+extent:U32 -> @+stride:U32 -> List<&2, Nat>
The axes of a shape of an extent at a stride, as a view of the shape reads one of its axes.
def read_at source · line 223 · raw
@axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+position:Nat -> @+shape:List<&2, U32> -> List<&2, Nat>
def longest_free source · line 229 · raw
@shape:List<&2, U32> -> @+taken:List<&2, Nat> -> @+index:Nat -> @+best:Nat -> @+extent:U32 -> Nat
def by_extent source · line 238 · raw
@remaining:Nat -> @+shape:List<&2, U32> -> @+taken:List<&2, Nat> -> List<&2, Nat>
The axes from the longest down, the later among equal extents first.
def lane_candidates source · line 248 · raw
@+shape:List<&2, U32> -> @+axis:Nat -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+target_axis:Nat -> List<&2, Nat>
The axes a gather may keep the lanes on: the input's own lane axis, the axis the view reads at the lane axis of its target, then every axis from the longest down.
def empty_cells source · line 255 · raw
@empty:Bool -> @count:Maybe<&2, U32> -> @+name:String -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
An empty target holds no value. A target with values read from an empty input reads past it.
def gather_empty source · line 260 · raw
@+name:String -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def unviewed_cells source · line 265 · raw
@status:0xa2af805348d03b11eb853850859654f6/tensor.Status -> @+name:String -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
A failed input keeps its problem; a gather without a view fails.
def gather_unviewed source · line 270 · raw
@status:0xa2af805348d03b11eb853850859654f6/tensor.Status -> @+name:String -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather_chosen source · line 273 · raw
@chosen:Maybe<&2, Nat> -> @+context:Gathering -> @+position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather_nonempty source · line 280 · raw
@empty:Bool -> @+name:String -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @+axis:Nat -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather_started source · line 290 · raw
@empty:Bool -> @+name:String -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @started:Pair(0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled, Nat) -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
def gather source · line 298 · raw
@+name:String -> @status:0xa2af805348d03b11eb853850859654f6/tensor.Status -> @source:Maybe<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.View> -> @+reversed:List<&2, Bool> -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @tiled:0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled -> 0xa2af805348d03b11eb853850859654f6/tensor_tiled.Tiled
The elements a view of a tiled tensor of extents shape selects, in the view's row-major order with the flagged axes in reverse, as a tiled tensor of extents target.