~/bend-docscommunity

tensor_layout.bend checks

raw source on the hub · import stelliferous@0.0.3.0/tensor_layout.bend as Tensor_layout

Layout operations consume their arguments. Copy keeps the bands and reshape relabels them. Transpose, slice, flip, upsampling and set_slice go through a view of the input: bands whose images and rows the view keeps in place run it on their own rows, other inputs first arrive as one band.

12 imports
import Base
import ./storage_buffer.bend as Storage
import ./tensor_shape.bend as Shapes
import ./tensor_view.bend as Views
import ./tensor_operations.bend as Operations
import ./tensor.bend as Tensors
import ./tensor_band.bend as Bands
import ./traversal_partition.bend as Partition
import ./tensor_band_concat.bend as BandConcat
import ./tensor_band_schedule.bend as BandSchedule
import ./tensor_band_view.bend as BandViews
import ./tensor_band_reduce.bend as BandReduce

Types

type Placing source · line 168 · raw

Data

What every band of a placement shares: the banded slice of the target geometry.

type Survey source · line 267 · raw

Data

Concatenation along an axis.

type Border source · line 472 · raw

@-Element:Data -> Data

Padding. Constant fills the new elements with one value and writes the tensor once, whatever the axes; Edge repeats the nearest element of the tensor one axis after another, so a corner holds the nearest corner element.

Definitions

def extents source · line 18 · raw

@view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> List<&2, U32>

def naturals source · line 23 · raw

@values:List<&2, U32> -> List<&2, Nat>

def permuted source · line 44 · raw

@view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @order:List<&2, Nat> -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

def sliced source · line 57 · raw

@view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @axis:U32 -> @start:U32 -> @count:U32 -> @step:U32 -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

def same_count source · line 67 · raw

@left:Maybe<&2, U32> -> @right:Maybe<&2, U32> -> Bool

def extent_at source · line 91 · raw

@extents:List<&2, U32> -> @axis:Nat -> U32

def leading source · line 94 · raw

@ranked:Bool -> @+shape:List<&2, U32> -> Maybe<&2, U32>

def planes source · line 100 · raw

@+shape:List<&2, U32> -> Maybe<&2, U32>

The number of planes before the last two axes; none below rank two.

def prepend_repeated source · line 105 · raw

@axis:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis -> @rest:Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>> -> Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>>

Nearest-neighbour upsampling repeats each element of the last two axes scale times, by copying from a view whose repeated axes have stride zero.

def repeated_axes source · line 110 · raw

@axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+scale:U32 -> Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>>

def with_offset source · line 118 · raw

@axes:Maybe<&2, List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis>> -> @offset:U32 -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

def repeated source · line 123 · raw

@view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @scale:U32 -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

def scaled_extents source · line 128 · raw

@extents:List<&2, U32> -> @+scale:U32 -> List<&2, U32>

def upsample_valid source · line 142 · raw

@+shape:List<&2, U32> -> @+scale:U32 -> Bool

The repeated extents and the output count fit the machine word.

def surveyed source · line 270 · raw

@survey:Survey -> @+first:List<&2, U32> -> @+shape:List<&2, U32> -> @+axis:Nat -> @status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @workers:U32 -> Survey

def with_extent source · line 299 · raw

@extents:List<&2, U32> -> @axis:Nat -> @+extent:U32 -> List<&2, U32>

def all_below source · line 381 · raw

@axes:List<&2, U32> -> @+rank:Nat -> Bool

Every listed axis is below the rank.

def chosen source · line 391 · raw

@member:Bool -> @+listed:Bool -> @+index:Nat -> @rest:List<&2, Nat> -> List<&2, Nat>

Reduction over listed axes. Output k, at the row-major index of the kept axes, folds the values of the reduced axes in row-major order, from initial, and holds finish of the fold: finish(operation(... operation(operation(initial, x[k, 0]), x[k, 1]) ..., x[k, R - 1])). The axes after the kept ones, in increasing index, are the reduced ones.

def axes_where source · line 397 · raw

@remaining:Nat -> @+index:Nat -> @+axes:List<&2, Nat> -> @+listed:Bool -> List<&2, Nat>

def extents_at source · line 402 · raw

@+shape:List<&2, U32> -> @indices:List<&2, Nat> -> List<&2, U32>

def every_index source · line 439 · raw

@remaining:Nat -> @+index:Nat -> List<&2, Nat>

The axes index, index + 1, ... of a shape, remaining of them.

def reversed_flags source · line 452 · raw

@remaining:Nat -> @+index:U32 -> @+axes:List<&2, U32> -> List<&2, Bool>

Reversal along axes: one gather of the view of the tensor with the listed axes read in reverse.

def flipped source · line 457 · raw

@valid:Bool -> @view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

def interior source · line 510 · raw

@before:List<&2, U32> -> @shape:List<&2, U32> -> @view:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @+axis:U32 -> Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View>

The view of the padded extents that holds the tensor: on every axis, the extent of the tensor starting after the elements added in front.

def all_zero source · line 515 · raw

@values:List<&2, U32> -> Bool

def padded_count source · line 542 · raw

@shape:Maybe<&2, List<&2, U32>> -> Maybe<&2, U32>

Templates

template copy_bands source · line 29 · raw

@-Element:Data -> @status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>)

The only layout operation that keeps its argument: (original, copy).

template copy source · line 40 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>)

template reordered source · line 50 · raw

@-Element:Data -> @name:String -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @order:List<&2, Nat> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The result's axis i is the source axis order[i].

template transpose source · line 54 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @order:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template slice source · line 63 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @axis:U32 -> @start:U32 -> @count:U32 -> @step:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Elements start, start + step, ... (count of them) along one axis.

template relabel_ready source · line 74 · raw

@-Element:Data -> @accepted:Bool -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @fill:Element -> @workers:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The bands keep their geometry and order under the target shape when it names as many elements.

template relabel source · line 80 · raw

@-Element:Data -> @accepted:Bool -> @current:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @fill:Element -> @workers:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template reshape source · line 87 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+shape:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Same elements in the same row-major order under new extents.

template upsample_checked source · line 134 · raw

@-Element:Data -> @valid:Bool -> @planes:Maybe<&2, U32> -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+shape:List<&2, U32> -> @+scale:U32 -> @+fill:Element -> @+workers:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template upsample_status source · line 148 · raw

@-Element:Data -> @status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+shape:List<&2, U32> -> @+scale:U32 -> @+fill:Element -> @+workers:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template upsample_nearest source · line 156 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+scale:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Nearest-neighbour upsampling of the last two axes: one gather through the view that repeats each row and each column scale times.

template settle source · line 160 · raw

@-Element:Data -> @valid:Bool -> @result:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_operations.Outcome<Pair(0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>)> -> Pair(Pair(0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>), Bool)

template placed_outcome source · line 171 · raw

@-Element:Data -> @+first:U32 -> @+rows:U32 -> @result:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_operations.Outcome<Pair(0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element>)> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Transformed(Element)

template placed_viewed source · line 176 · raw

@-Element:Data -> @source:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @slice:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View -> @+first:U32 -> @+rows:U32 -> @target:0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element> -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Transformed(Element)

template placed_band source · line 184 · raw

@-Element:Data -> @context:Placing -> @first:U32 -> @rows:U32 -> @target:0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element> -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/storage_buffer.Buffer<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Transformed(Element)

A band of the target takes the band of the part of the same rows, written through the local view of the slice.

template place_planned source · line 189 · raw

@-Element:Data -> @+name:String -> @+banded:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band_view.Banded -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @owners:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element), 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Plan) -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template mismatched source · line 196 · raw

@-Element:Data -> @name:String -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template place_whole source · line 200 · raw

@-Element:Data -> @+name:String -> @found:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band_view.Banded> -> @+whole:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @target:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template place_target source · line 207 · raw

@-Element:Data -> @+name:String -> @+axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+offset:U32 -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The target first arrives as one band of one row.

template place_rows source · line 214 · raw

@-Element:Data -> @+name:String -> @repeats:List<&2, U32> -> @+before:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+after:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+start:U32 -> @+axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+offset:U32 -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The part arrives in the rows of the target, so a slice writes band by band only when it repeats no row.

template place_found source · line 223 · raw

@-Element:Data -> @+name:String -> @found:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band_view.Banded> -> @+axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+offset:U32 -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Target bands whose images and rows the slice keeps in place take the part band by band; other targets first arrive as one band of one row.

template place_checked source · line 233 · raw

@-Element:Data -> @+name:String -> @same:Bool -> @empty:Bool -> @+axes:List<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.Axis> -> @+offset:U32 -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

A part of the extents of the slice is written; a part with no element writes nothing.

template place_slice source · line 242 · raw

@-Element:Data -> @+name:String -> @slice:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The slice comes taken apart, so that no View value is used twice: that would make every View constructor shared.

template place_status source · line 250 · raw

@-Element:Data -> @+name:String -> @target_status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @part_status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @slice:Maybe<&2, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor_view.View> -> @bands:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Bands(Element) -> @+geometry:0xd6aaab858a4fbd1461bd0fee27b97184/tensor_band.Geometry -> @+target_shape:List<&2, U32> -> @+part_shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template set_slice source · line 259 · raw

@-Element:Data -> @target:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axis:U32 -> @start:U32 -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

target[..., start : start + part extent, ...] = part along axis: the part is written through the slice of the target that it replaces.

template prepend_survey source · line 279 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @result:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Survey) -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Survey)

template survey source · line 284 · raw

@-Element:Data -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> @+first:List<&2, U32> -> @+axis:Nat -> @summary:Survey -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Survey)

Summarizes the extents of every part and returns the parts in order.

template appended_shaped source · line 302 · raw

@-Element:Data -> @+axis:U32 -> @+start:U32 -> @output:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @shaped:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, List<&2, U32>) -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32)

template append_at source · line 306 · raw

@-Element:Data -> @+axis:U32 -> @+start:U32 -> @output:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32)

template append_part source · line 309 · raw

@-Element:Data -> @+axis:U32 -> @state:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32) -> @part:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32)

template appended_all source · line 313 · raw

@-Element:Data -> @state:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32) -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template append_parts source · line 317 · raw

@-Element:Data -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> @+axis:U32 -> @state:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, U32) -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template band_joined source · line 324 · raw

@-Element:Data -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> @shape:List<&2, U32> -> @fill:Element -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The leaf concat of the bands of the parts at one band of the output, along the middle axis of [outer, extent, inner], into a tensor of that band shape.

template join_counted source · line 329 · raw

@-Element:Data -> @count:Maybe<&2, U32> -> @+shape:List<&2, U32> -> @+axis:U32 -> @+fill:Element -> @+workers:U32 -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The parts meet in one plan of the rows of their joining, and every band of the output appends the bands of the parts there.

template join_shaped source · line 337 · raw

@-Element:Data -> @empty:Bool -> @+shape:List<&2, U32> -> @+axis:U32 -> @+fill:Element -> @+workers:U32 -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

An empty result has no element to place.

template join_status source · line 342 · raw

@-Element:Data -> @status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @valid:Bool -> @+first:List<&2, U32> -> @+shape:List<&2, U32> -> @+axis:U32 -> @+fill:Element -> @+workers:U32 -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template joined source · line 349 · raw

@-Element:Data -> @+first:List<&2, U32> -> @+axis:U32 -> @+fill:Element -> @surveyed:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Survey) -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template lead source · line 354 · raw

@-Element:Data -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Pair(List<&2, U32>, Element))

template concat_first source · line 367 · raw

@-Element:Data -> @+axis:U32 -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> @+shape:List<&2, U32> -> @+fill:Element -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template concat_led source · line 371 · raw

@-Element:Data -> @+axis:U32 -> @led:Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element>, Pair(List<&2, U32>, Element)) -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template concat source · line 377 · raw

@-Element:Data -> @parts:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Parts<Element> -> @+axis:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Parts agree on every extent except axis; the result stacks them in order.

template reduce_counted source · line 407 · raw

@-Element:Data -> @-Accumulator:Data -> @-operation:(@_:Accumulator -> @_:Element -> Accumulator) -> @-finish:(@_:Accumulator -> Element) -> @+name:String -> @+operations:F32 -> @count:Maybe<&2, U32> -> @length:Maybe<&2, U32> -> @+initial:Accumulator -> @+shape:List<&2, U32> -> @+kept:List<&2, Nat> -> @+reduced:List<&2, Nat> -> @+fill:Element -> @+workers:U32 -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template reduce_listed source · line 418 · raw

@-Element:Data -> @-Accumulator:Data -> @-operation:(@_:Accumulator -> @_:Element -> Accumulator) -> @-finish:(@_:Accumulator -> Element) -> @name:String -> @+operations:F32 -> @+initial:Accumulator -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+kept:List<&2, Nat> -> @+reduced:List<&2, Nat> -> @valid:Bool -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The reduction of the axes reduced, the others kept, both in increasing index. A failed tensor keeps its problem; an invalid list of axes fails.

template reduce_axes source · line 430 · raw

@-Element:Data -> @-Accumulator:Data -> @-operation:(@_:Accumulator -> @_:Element -> Accumulator) -> @-finish:(@_:Accumulator -> Element) -> @name:String -> @+operations:F32 -> @+initial:Accumulator -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axes:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The result has the extents of the kept axes. Every listed axis is below the rank and listed once. operations prices the combination of one value.

template reduce_all source · line 445 · raw

@-Element:Data -> @-Accumulator:Data -> @-operation:(@_:Accumulator -> @_:Element -> Accumulator) -> @-finish:(@_:Accumulator -> Element) -> @name:String -> @+operations:F32 -> @+initial:Accumulator -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The reduction of every element: no axis kept, every axis reduced.

template flip source · line 463 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axes:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The elements in reverse order along every listed axis; an axis is listed once.

template border_name source · line 476 · raw

@-Element:Data -> @border:Border<Element> -> String

template strip_of source · line 482 · raw

@-Element:Data -> @+axis:U32 -> @from_end:Bool -> @+count:U32 -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

The elements at one end of axis, repeated count times: (strip, tensor).

template edge_strip source · line 490 · raw

@-Element:Data -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axis:U32 -> @from_end:Bool -> @+count:U32 -> Pair(0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>, 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>)

The elements at one end of axis, repeated count times: (strip, tensor).

template pad_edge_axis source · line 494 · raw

@-Element:Data -> @unchanged:Bool -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axis:U32 -> @+before:U32 -> @+after:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template pad_edge_axes source · line 502 · raw

@-Element:Data -> @before:List<&2, U32> -> @after:List<&2, U32> -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+axis:U32 -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template padded_into source · line 522 · raw

@-Element:Data -> @count:Maybe<&2, U32> -> @+value:Element -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+before:List<&2, U32> -> @+padded:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

Constant padding: storage of the padded extents filled with the value, then the tensor written through the interior view. One copy whatever the axes.

template pad_constant source · line 532 · raw

@-Element:Data -> @unchanged:Bool -> @+value:Element -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+before:List<&2, U32> -> @+padded:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template pad_border source · line 537 · raw

@-Element:Data -> @border:Border<Element> -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+before:List<&2, U32> -> @+after:List<&2, U32> -> @padded:Maybe<&2, List<&2, U32>> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template pad_valid source · line 547 · raw

@-Element:Data -> @+border:Border<Element> -> @status:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Status -> @valid:Bool -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @shape:List<&2, U32> -> @before:List<&2, U32> -> @after:List<&2, U32> -> @padded:Maybe<&2, List<&2, U32>> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

template pad source · line 556 · raw

@-Element:Data -> @+border:Border<Element> -> @tensor:0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element> -> @+before:List<&2, U32> -> @+after:List<&2, U32> -> 0xd6aaab858a4fbd1461bd0fee27b97184/tensor.Tensor<Element>

before[i] elements are added in front of axis i and after[i] behind it. Both lists have one entry per axis and the padded extents must be allocatable.