tensor_band_view.bend checks
raw source on the hub · import stelliferous@0.0.3.0/tensor_band_view.bend as Tensor_band_view
A view of the storage of a geometry, seen from its bands. A view that keeps the images and the rows of the geometry in place has axes before the rows, repeats of each row and axes after the rows, each moving by whole channels and columns; every band reads its cells through the same axes over its own rows.
4 imports
import Base import ./tensor_view.bend as Views import ./tensor_shape.bend as Shapes import ./tensor_band.bend as Bands
Types
type Banded source · line 13 · raw
Data
The axes before the rows, the repeats of each row, the axes after the rows, and the offset of the view, as the view gives them.
Banded@before:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @repeats:List<&2, U32> -> @after:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @offset:U32 -> Banded
type Split source · line 133 · raw
Data
The axes before the rows axis and those after it.
Split@before:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @rest:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Split
Definitions
def component source · line 20 · raw
@+plane:U32 -> @column:Bool -> @+word:U32 -> U32
The channel of plane words a word of the storage of a geometry lies in, or its column within that channel.
def localized source · line 28 · raw
@+plane:U32 -> @+band:U32 -> @+word:U32 -> U32
A word of the storage of the geometry, a channel of plane words and a column within it, as the same channel and column in a band of band words per channel.
def localized_axes source · line 31 · raw
@+plane:U32 -> @+band:U32 -> @axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>
def repeated source · line 36 · raw
@repeats:List<&2, U32> -> List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>
def rows_axes source · line 43 · raw
@rowed:Bool -> @+rows:U32 -> @+width:U32 -> @repeats:List<&2, U32> -> List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>
The rows axis, which a view of a geometry of one row per image leaves out, and the repeats of each row.
def axes source · line 50 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+rows:U32 -> List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>
The axes of the view over rows rows of each channel. A band of a geometry of one row per image has at most one row.
def local source · line 58 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+rows:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View
The view of the local storage of a band of rows rows.
def extents source · line 64 · raw
@+banded:Banded -> @+rows:U32 -> List<&2, U32>
The extents of the view over rows rows.
def known source · line 68 · raw
@count:Maybe<&2, U32> -> U32
def product_or_zero source · line 73 · raw
@extents:List<&2, U32> -> U32
def scale source · line 77 · raw
@+banded:Banded -> U32
The rows of the output for each row of the input.
def output source · line 83 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry
The geometry of the output: the same images, the axes before the rows as channels, each row repeated, the axes after the rows as columns.
def count_when source · line 90 · raw
@present:Bool -> Nat
def local_when source · line 95 · raw
@valid:Bool -> @flags:List<&2, Bool> -> Maybe<&2, List<&2, Bool>>
def local_directions source · line 102 · raw
@+before:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+repeats:List<&2, U32> -> @+after:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+before_flags:List<&2, Bool> -> @+after_flags:List<&2, Bool> -> List<&2, Bool>
The flags of the axes of a local view: those of the axes before the rows, the rows axis and its repeats forward, those of the axes after the rows.
def local_flags source · line 109 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+flags:List<&2, Bool> -> Maybe<&2, List<&2, Bool>>
The flags of the local view of a band, when the view reads its images axis, its rows axis and the repeats of each row forward. An axis without a flag is read forward.
def images_kept source · line 121 · raw
@kept:Bool -> @rest:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>>
The axes after the images axis, which a view of more than one image starts with.
def after_images source · line 126 · raw
@many:Bool -> @+batch:U32 -> @+image:U32 -> @axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>>
def prepend_before source · line 136 · raw
@axis:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis -> @split:Maybe<&2, Split> -> Maybe<&2, Split>
def split_from source · line 141 · raw
@rest:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @found:Bool -> @+height:U32 -> @+width:U32 -> @+extent:U32 -> @+stride:U32 -> Maybe<&2, Split>
def split_rows source · line 148 · raw
@+height:U32 -> @+width:U32 -> @axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Maybe<&2, Split>
def prepend_repeat source · line 154 · raw
@extent:U32 -> @split:Pair(List<&2, U32>, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>) -> Pair(List<&2, U32>, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>)
The leading axes of stride zero repeat each row.
def repeats_from source · line 158 · raw
@rest:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @zero:Bool -> @extent:U32 -> @stride:U32 -> Pair(List<&2, U32>, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>)
def split_repeats source · line 164 · raw
@axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Pair(List<&2, U32>, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>)
def reach source · line 170 · raw
@+plane:U32 -> @+column:Bool -> @axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @start:Maybe<&2, U32> -> Maybe<&2, U32>
The largest channel, or column, the axes reach from a start.
def below source · line 177 · raw
@reach:Maybe<&2, U32> -> @+limit:U32 -> Bool
def counted source · line 182 · raw
@extents:List<&2, U32> -> Bool
def kept_when source · line 188 · raw
@valid:Bool -> @banded:Banded -> Maybe<&2, Banded>
A classification is kept when the geometry has images and rows, every axis stays inside the channels and the columns of a band and every group of extents has a count.
def fits source · line 193 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> Bool
def kept source · line 201 · raw
@+banded:Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> Maybe<&2, Banded>
def split_kept source · line 204 · raw
@+offset:U32 -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @before:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @split:Pair(List<&2, U32>, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>) -> Maybe<&2, Banded>
def rowed_split source · line 208 · raw
@+offset:U32 -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @split:Maybe<&2, Split> -> Maybe<&2, Banded>
def split_geometry source · line 213 · raw
@+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> Maybe<&2, Split>
def classify_rows source · line 217 · raw
@rowed:Bool -> @axes:Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>> -> @+offset:U32 -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> Maybe<&2, Banded>
def classify source · line 228 · raw
@axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+offset:U32 -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> Maybe<&2, Banded>
The banded form of a view, given by its axes and offset, of the storage of a geometry, when the view starts with the images axis of a batch of more than one image, has the rows axis of a geometry of more than one row, and stays inside the channels and columns. A geometry of one image of one row, as a whole tensor has, takes every view whose addresses fit it.