~/bend-docscommunity

tensor.bend checks

raw source on the hub · import stelliferous@0.0.4.0/tensor.bend as Tensor

A public tensor owns pieces of its stored elements, the shape of those elements, the value used to initialize allocations, a sticky status, and the number of workers its operations may use. The pieces are the grid of the shape (lib/tensor_grid.bend): two tensors of one shape have the same pieces. A failed operation leaves values untouched and records why. Later operations skip a failed tensor, and check is the only way to observe or clear the failure.

15 imports
import Base
import ./storage_buffer.bend as Storage
import ./storage_allocation.bend as Allocation
import ./storage_copy.bend as Copy
import ./storage_clone.bend as Clone
import ./tensor_shape.bend as Shapes
import ./tensor_view.bend as Views
import ./tensor_operations.bend as Operations
import ./machine_limits.bend as Machine
import ./default_machine_limits.bend as Default
import ./tensor_grid.bend as Grid
import ./tensor_pieces.bend as Pieces
import ./tensor_tasks.bend as Tasks
import ./tensor_move.bend as Move
import ./traversal_partition.bend as Partition

Types

type Reason source · line 24 · raw

Data

type Problem source · line 31 · raw

Data

type Status source · line 34 · raw

Data

type Tensor source · line 42 · raw

@-Element:Data -> Type

Like a PyTorch tensor's device, workers is execution context: the size of the runtime's worker pool, read once with IO.thread_count and set with with_workers. Pure constructors cannot read it and use one worker. Results keep the largest worker count of their operands. It never changes a value.

type Parts source · line 48 · raw

@-Element:Data -> Type

A nonempty sequence of tensors. Base List is not used for tensors: the compiler shares every constructor of a list type that is duplicated anywhere, and that sharing would reach the certificate inside each tensor's storage.

type Spread source · line 404 · raw

@-Later:Data -> Data

What every piece of a broadcast reads: the shape of the result, the view of the right operand with its extents and the context of the step after it.

type Origin source · line 537 · raw

Data

One source of a moving operation: the shape, grid and ranges of its cells and the cell whose coordinates fix the source axes no target axis reads.

type Sources source · line 546 · raw

@-Element:Data -> Type

The pieces of every source of a moving operation, in the order of its origins.

type Moving source · line 553 · raw

@-Element:Data -> @-Context:Data -> Data

What every task of a moving operation reads: the components, the sources, the shape and grid of the target, the fill of new storage and the context of the gather.

type Holdings source · line 637 · raw

@-Element:Data -> Type

The pieces one task holds of every source.

type Depositing source · line 696 · raw

@-Element:Data -> Data

Where the pieces of a finish go: the ranges of the target pieces, and the fill of the storage of a target piece written in parts.

type Viewed source · line 776 · raw

Data

A view of the source cells taken apart, read by every target piece.

type Then source · line 809 · raw

@-Context:Data -> @-Later:Data -> Data

A gather, then a map of every target piece it fills.

type Placing source · line 837 · raw

Data

A target filled from sources placed in it: the cell extents of every source, and per source and axis the segments it fills.

type Waiting source · line 842 · raw

@-Element:Data -> Type

The holdings of the sources already placed, each waiting for the holdings after it, and the target piece.

type Placed source · line 846 · raw

@-Element:Data -> Type

Definitions

def within source · line 53 · raw

@fits:Bool -> @count:U32 -> Maybe<&2, U32>

Element count of a shape that the default machine can allocate.

def allocatable source · line 58 · raw

@count:Maybe<&2, U32> -> Maybe<&2, U32>

def count_of source · line 63 · raw

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

def known_count source · line 66 · raw

@count:Maybe<&2, U32> -> U32

def count_or_zero source · line 72 · raw

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

The element count as a number; a shape too large to allocate counts 0.

def view_of source · line 75 · raw

@+shape:List<&2, U32> -> Maybe<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.View>

def significant_bits source · line 81 · raw

@remaining:Nat -> @+value:U32 -> @+bits:Nat -> @zero:Bool -> Nat

Bits of value, counted by tail recursion. Storage.bit_length is not tail recursive, and a non-tail recursive callee turns the calling chain into worklist dispatch: measured allocation of 2^20 floats took twice as long.

def depth_for source · line 85 · raw

@+count:U32 -> Nat

The smallest depth whose capacity holds count elements (at least one).

def grid_of source · line 91 · raw

@+shape:List<&2, U32> -> 0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid

def usable source · line 168 · raw

@status:Status -> Bool

def matches_count source · line 228 · raw

@count:Maybe<&2, U32> -> @length:Nat -> Bool

def first_failure source · line 316 · raw

@left:Status -> @right:Status -> Status

def stretched source · line 322 · raw

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

A view of an operand read with the extents target, see Views.stretch.

def pass_rows source · line 354 · raw

@+operands:F32 -> @+operations:F32 -> F32

What one cell of a pass over pieces counts: a load of each operand, the rows of its operation and a store, and two steps of its loop.

def pass_steps source · line 357 · raw

F32

def spread_view source · line 407 · raw

@view:Maybe<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.View> -> 0xa2af805348d03b11eb853850859654f6/tensor_view.View

def origin source · line 540 · raw

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

def side_of source · line 557 · raw

@layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+cell:U32 -> Bool

Whether the piece that starts at cell lies in the right half of a split.

def move_rows source · line 762 · raw

F32

A view or a placing adds no rows to the move of a target cell.

def view_axes source · line 780 · raw

@axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+flags:List<&2, Bool> -> @+strides:List<&2, U32> -> List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis>

Every axis of a view restricted to a target piece, with its direction.

def view_part source · line 787 · raw

@+reversed:List<&2, Bool> -> @+extents:List<&2, U32> -> @view:0xa2af805348d03b11eb853850859654f6/tensor_view.View -> 0xa2af805348d03b11eb853850859654f6/tensor_move.Part

def origin_shapes source · line 882 · raw

@origins:List<&2, Origin> -> List<&2, List<&2, U32>>

def show_extents source · line 1023 · raw

@extents:List<&2, U32> -> String

def show_shape source · line 1029 · raw

@extents:List<&2, U32> -> String

def explain source · line 1032 · raw

@reason:Reason -> String

def describe source · line 1045 · raw

@problem:Problem -> String

Templates

template buffer source · line 88 · raw

@-Element:Data -> @+fill:Element -> @+count:U32 -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

template cut_copied source · line 96 · raw

@-Element:Data -> @+first:U32 -> @+count:U32 -> @owners:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template cut_piece source · line 100 · raw

@-Element:Data -> @fill:Element -> @first:U32 -> @count:U32 -> @source:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template cut_when source · line 106 · raw

@-Element:Data -> @single:Bool -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+fill:Element -> @source:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template cut source · line 115 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+fill:Element -> @source:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

One buffer of the elements of a shape in the pieces of its grid. A grid of one piece keeps the buffer, otherwise every piece copies its range.

template joined source · line 121 · raw

@-Element:Data -> @+count:U32 -> @+fill:Element -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

The pieces back in one buffer, in order: a copy of their cells. A single piece is the buffer.

template filled_piece source · line 127 · raw

@-Element:Data -> @fill:Element -> @first:U32 -> @count:U32 -> @state:Unit -> Pair(Unit, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template filled_grid source · line 134 · raw

@-Element:Data -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+value:Element -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

Pieces of a grid, every element value.

template filled source · line 138 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+value:Element -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

Pieces of a shape, every element value.

template whole_status source · line 141 · raw

@-Element:Data -> @status:Status -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+shape:List<&2, U32> -> @+fill:Element -> @workers:U32 -> Tensor<Element>

template whole source · line 148 · raw

@-Element:Data -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+shape:List<&2, U32> -> @+fill:Element -> @status:Status -> @workers:U32 -> Tensor<Element>

Row-major storage of a usable tensor as its pieces. A failed tensor keeps the storage as one piece.

template values source · line 153 · raw

@-Element:Data -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+shape:List<&2, U32> -> @+fill:Element -> @status:Status -> @workers:U32 -> Tensor<Element>

Values at the boundary of the library: row-major storage of a shape kept as one piece. Only the boundary reads them, the tiled form takes them whole.

template with_whole source · line 157 · raw

@-Element:Data -> @-Result:Type -> @tensor:Tensor<Element> -> @body:(@_:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @_:List<&2, U32> -> @_:Element -> @_:Status -> @_:U32 -> Result) -> Result

The storage of a tensor in row-major order.

template with_metadata source · line 163 · raw

@-Element:Data -> @-Result:Type -> @tensor:Tensor<Element> -> @body:(@_:Tensor<Element> -> @_:List<&2, U32> -> @_:Element -> @_:Status -> @_:U32 -> Result) -> Result

Metadata inspection retains the pieces and their owners.

template failed source · line 174 · raw

@-Element:Data -> @operation:String -> @reason:Reason -> @shape:List<&2, U32> -> @+fill:Element -> @workers:U32 -> Tensor<Element>

A failed tensor holds one empty piece.

template full_count source · line 179 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @count:Maybe<&2, U32> -> @+value:Element -> Tensor<Element>

template full source · line 184 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+value:Element -> Tensor<Element>

template listed_count source · line 187 · raw

@-Element:Data -> @matches:Bool -> @+shape:List<&2, U32> -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+fill:Element -> Tensor<Element>

template listed_written source · line 192 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @written:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, Bool) -> @+fill:Element -> Tensor<Element>

template listed source · line 197 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @count:Maybe<&2, U32> -> @values:List<&2, Element> -> @+fill:Element -> Tensor<Element>

The list is written while it is counted, so it is read once.

template values_count source · line 203 · raw

@-Element:Data -> @matches:Bool -> @+shape:List<&2, U32> -> @+count:U32 -> @items:List<&2, Element> -> @+fill:Element -> Tensor<Element>

template values_listed source · line 209 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @count:Maybe<&2, U32> -> @+items:List<&2, Element> -> @+fill:Element -> Tensor<Element>

The list of an entry is counted before its buffer is allocated.

template values_of source · line 215 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+items:List<&2, Element> -> @+fill:Element -> Tensor<Element>

Values of a shape from a list, one piece.

template from_list source · line 220 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+values:List<&2, Element> -> @+fill:Element -> Tensor<Element>

fill initializes storage this tensor or its results allocate; it is never observable in a successful result.

template stored source · line 223 · raw

@-Element:Data -> @matches:Bool -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+shape:List<&2, U32> -> @+fill:Element -> Tensor<Element>

template storage_of source · line 233 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @count:Maybe<&2, U32> -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+fill:Element -> Tensor<Element>

template from_storage source · line 239 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+fill:Element -> Tensor<Element>

Storage handed over by foreign I/O keeps its documented trust boundary. The values stay one piece.

template with_workers source · line 245 · raw

@-Element:Data -> @tensor:Tensor<Element> -> @+count:U32 -> Tensor<Element>

Sets the worker count, at least one. Values and status are unchanged.

template workers source · line 249 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Pair(Tensor<Element>, U32)

template shape source · line 255 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Pair(Tensor<Element>, List<&2, U32>)

template checked source · line 259 · raw

@-Element:Data -> @status:Status -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @shape:List<&2, U32> -> @fill:Element -> @workers:U32 -> Result<&1, &1, Pair(Tensor<Element>, Problem), Tensor<Element>>

template check source · line 265 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Result<&1, &1, Pair(Tensor<Element>, Problem), Tensor<Element>>

template released source · line 269 · raw

@-Element:Data -> @status:Status -> @storage:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Result<&2, &1, Problem, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>>

template into_storage source · line 274 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Result<&2, &1, Problem, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>>

template listed_values source · line 277 · raw

@-Element:Data -> @status:Status -> @storage:Array<Element> -> @length:Nat -> Result<&2, &2, Problem, List<&2, Element>>

template listed_buffer source · line 282 · raw

@-Element:Data -> @status:Status -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Result<&2, &2, Problem, List<&2, Element>>

template to_list source · line 286 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Result<&2, &2, Problem, List<&2, Element>>

template only_value source · line 290 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @values:List<&2, Element> -> Result<&2, &2, Problem, Element>

template single source · line 295 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @values:Result<&2, &2, Problem, List<&2, Element>> -> Result<&2, &2, Problem, Element>

template item source · line 300 · raw

@-Element:Data -> @tensor:Tensor<Element> -> Result<&2, &2, Problem, Element>

template value_or source · line 306 · raw

@-Value:Data -> @result:Result<&2, &2, Problem, Value> -> @fallback:Value -> Value

The value read, or fallback when the tensor carries a failure.

template with_status source · line 327 · raw

@-Element:Data -> @status:Status -> @tensor:Tensor<Element> -> Tensor<Element>

template PieceMap source · line 334 · raw

@-Element:Data -> @-Context:Data -> Type

A map of one piece: the cells of first cell first and count cells in place.

template Kernel source · line 339 · raw

@-Element:Data -> Type

The kernel of an elementwise combination: count left elements in place with the right elements a view reads.

template mapped_piece source · line 342 · raw

@-Element:Data -> @-Context:Data -> @-leaf:PieceMap(Element, Context) -> @context:Context -> @first:U32 -> @count:U32 -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @resource:Unit -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template mapped_decided source · line 347 · raw

@-Element:Data -> @-Context:Data -> @-leaf:PieceMap(Element, Context) -> @context:Context -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+shape:List<&2, U32> -> @fill:Element -> @+workers:U32 -> Tensor<Element>

template mapped_status source · line 360 · raw

@-Element:Data -> @-Context:Data -> @-leaf:PieceMap(Element, Context) -> @context:Context -> @operations:F32 -> @status:Status -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+shape:List<&2, U32> -> @fill:Element -> @+workers:U32 -> Tensor<Element>

template map_pieces source · line 368 · raw

@-Element:Data -> @-Context:Data -> @-leaf:PieceMap(Element, Context) -> @context:Context -> @operations:F32 -> @tensor:Tensor<Element> -> Tensor<Element>

The leaf on every piece in place, tasks deciding parallelism. operations counts the vector rows of the leaf's work on one cell.

template same source · line 372 · raw

@-Element:Data -> @value:Element -> Element

template combined source · line 375 · raw

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

template combine_buffers source · line 381 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @first:U32 -> @count:U32 -> @left:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @right:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @resource:Unit -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

Two pieces of one range combined in place in the left, then the step after.

template zipped_decided source · line 388 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @+shape:List<&2, U32> -> @fill:Element -> @+workers:U32 -> @pairs:0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Paired<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>>, Unit> -> Tensor<Element>

template combine_equal source · line 395 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @status:Status -> @+workers:U32 -> @+shape:List<&2, U32> -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> Tensor<Element>

Operands of one shape have the same pieces: the trees zip leaf by leaf.

template spread_outcome source · line 412 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @+later:Later -> @+first:U32 -> @+count:U32 -> @result:0xa2af805348d03b11eb853850859654f6/tensor_operations.Outcome<Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template spread_piece source · line 418 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @context:Spread<Later> -> @first:U32 -> @count:U32 -> @left:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @right:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template shared_buffer source · line 427 · raw

@-Element:Data -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template spread_decided source · line 430 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @+workers:U32 -> @+shape:List<&2, U32> -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> Tensor<Element>

template combine_spread source · line 439 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @+workers:U32 -> @+shape:List<&2, U32> -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+right_shape:List<&2, U32> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> Tensor<Element>

A right operand is read whole by every task, one owner a task, through a view of it with the left extents: a task beyond the first clones it.

template combine_stretched source · line 447 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @+workers:U32 -> @+shape:List<&2, U32> -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+right_shape:List<&2, U32> -> @view:0xa2af805348d03b11eb853850859654f6/tensor_view.View -> Tensor<Element>

A right operand of other extents read through its view stretched to the left extents.

template copy_leaf source · line 455 · raw

@-Element:Data -> @context:Unit -> @first:U32 -> @count:U32 -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @resource:Unit -> 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>), Unit>

template copy_pair source · line 459 · raw

@-Element:Data -> @+first:U32 -> @+count:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template copy_halves source · line 463 · raw

@-Element:Data -> @left:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)) -> @right:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template unzipped source · line 470 · raw

@-Element:Data -> @tree:0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>), Unit> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

The tree of pairs as the two trees.

template copy_decided source · line 475 · raw

@-Element:Data -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template copies_of source · line 479 · raw

@-Element:Data -> @+shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)) -> Pair(Tensor<Element>, Tensor<Element>)

template copy_status source · line 483 · raw

@-Element:Data -> @+bytes_per_element:F32 -> @status:Status -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+shape:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> Pair(Tensor<Element>, Tensor<Element>)

template copied source · line 492 · raw

@-Element:Data -> @+bytes_per_element:F32 -> @tensor:Tensor<Element> -> Pair(Tensor<Element>, Tensor<Element>)

The only operation that keeps its argument: (original, copy). Every task copies its own pieces. bytes_per_element counts the bytes of one element.

template flat_leaf source · line 498 · raw

@-Element:Data -> @+first:U32 -> @+count:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template flat_piece source · line 502 · raw

@-Element:Data -> @fill:Element -> @first:U32 -> @count:U32 -> @holding:0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template flat_moved source · line 509 · raw

@-Element:Data -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+fill:Element -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

The same cells in the pieces of another grid, in one serial pass.

template relabel_when source · line 515 · raw

@-Element:Data -> @same:Bool -> @regrouped:Bool -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+target:List<&2, U32> -> @+fill:Element -> @workers:U32 -> Tensor<Element>

The same grid keeps the tree. A grid that cuts the cells at the same places keeps every piece in a tree of its ranges. Another grid moves the cells.

template relabel_status source · line 522 · raw

@-Element:Data -> @status:Status -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @+fill:Element -> @workers:U32 -> Tensor<Element>

template relabeled source · line 531 · raw

@-Element:Data -> @tensor:Tensor<Element> -> @+target:List<&2, U32> -> Tensor<Element>

The same cells in the same order under another shape of the same count. A shape of the same grid keeps the pieces, another grid moves the cells into its pieces.

template exchanged_left source · line 562 · raw

@-Element:Data -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template exchanged_right source · line 566 · raw

@-Element:Data -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template exchanged source · line 572 · raw

@-Element:Data -> @tree:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left_side:Bool -> @+cell:U32 -> @replacement:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

The piece that starts at cell in a tree whose ranges are layout, and the tree with replacement in its place.

template exchange source · line 581 · raw

@-Element:Data -> @tree:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+cell:U32 -> @replacement:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template taken_joined source · line 584 · raw

@-Element:Data -> @data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+first:U32 -> @+count:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template taken_on source · line 591 · raw

@-Element:Data -> @pieces:List<&2, U32> -> @exchanged:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+fill:Element -> @+first:U32 -> @+count:U32 -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

The piece exchanged out of the tree, of first cell first and count cells, and the pieces listed after it taken out in order.

template taken_inputs source · line 604 · raw

@-Element:Data -> @pieces:List<&2, U32> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+fill:Element -> @tree:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

The listed source pieces taken out of the source tree in order, as the pieces of one task.

template sources_joined source · line 611 · raw

@-Element:Data -> @own:Pair(0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)) -> @later:Pair(Sources<Element>, Sources<Element>) -> Pair(Sources<Element>, Sources<Element>)

template taken_sources source · line 617 · raw

@-Element:Data -> @origins:List<&2, Origin> -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+source:U32 -> @+index:U32 -> @+fill:Element -> @sources:Sources<Element> -> Pair(Sources<Element>, Sources<Element>)

The source pieces of component index of every source, taken out in order.

template inputs_leaf source · line 624 · raw

@-Element:Data -> @+first:U32 -> @+count:U32 -> @pair:Pair(Sources<Element>, Sources<Element>) -> Pair(Sources<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Sources<Element>, Unit>)

template component_inputs source · line 629 · raw

@-Element:Data -> @-Context:Data -> @context:Moving<Element, Context> -> @first:U32 -> @count:U32 -> @sources:Sources<Element> -> Pair(Sources<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Sources<Element>, Unit>)

Prepare: the source pieces of component first, routed in source order.

template holdings source · line 641 · raw

@-Element:Data -> @sources:Sources<Element> -> Holdings<Element>

template Gather source · line 648 · raw

@-Element:Data -> @-Context:Data -> Type

A gather writes the cells of the target piece of first cell first and count cells from the pieces its task holds.

template gathered_walked source · line 652 · raw

@-Element:Data -> @lefts:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Lefts<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>> -> @+first:U32 -> @+count:U32 -> @result:Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walked<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, Holdings<Element>>

template gathered_pieces source · line 659 · raw

@-Element:Data -> @-Context:Data -> @-gather:Gather(Element, Context) -> @pieces:List<&2, U32> -> @+context:Context -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+target_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+fill:Element -> @ready:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walking<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, Holdings<Element>> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walked<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, Holdings<Element>>

The target pieces of a task, each gathered in target order. Each piece waits on the left for the pieces after it, so the task calls no closure.

template walked_pieces source · line 677 · raw

@-Element:Data -> @walked:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walked<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>, Holdings<Element>> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template component_run source · line 682 · raw

@-Element:Data -> @-Context:Data -> @-gather:Gather(Element, Context) -> @context:Moving<Element, Context> -> @first:U32 -> @count:U32 -> @inputs:Sources<Element> -> @resource:Unit -> 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), Unit>

One task: the pieces it holds of every source, then its target pieces.

template slot_piece source · line 690 · raw

@-Element:Data -> @fill:Element -> @first:U32 -> @count:U32 -> @state:Unit -> Pair(Unit, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element))

template sized_when source · line 701 · raw

@-Element:Data -> @short:Bool -> @data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+span:U32 -> @+fill:Element -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

A buffer of at least span cells: storage, as the slots of a finish start empty.

template sized source · line 706 · raw

@-Element:Data -> @data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+span:U32 -> @+fill:Element -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

template slot_written source · line 713 · raw

@-Element:Data -> @whole:Bool -> @data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+slot:U32 -> @+span:U32 -> @+first:U32 -> @+count:U32 -> @+fill:Element -> @part:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

The slot of span cells from slot after a part of count cells from first: the part itself when it is the whole slot, else the slot with the part copied in.

template deposited source · line 721 · raw

@-Element:Data -> @tree:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left_side:Bool -> @+first:U32 -> @+count:U32 -> @+fill:Element -> @part:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

The tree whose ranges are layout with the part of count cells from first written in the piece that holds its first cell.

template placed_when source · line 732 · raw

@-Element:Data -> @empty:Bool -> @+depositing:Depositing<Element> -> @+first:U32 -> @+count:U32 -> @input:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @slots:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template placed_piece source · line 739 · raw

@-Element:Data -> @depositing:Depositing<Element> -> @first:U32 -> @count:U32 -> @input:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @slots:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template placed_component source · line 745 · raw

@-Element:Data -> @depositing:Depositing<Element> -> @first:U32 -> @count:U32 -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @slots:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template placed source · line 750 · raw

@-Element:Data -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+fill:Element -> @outputs:0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element), Unit> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

Finish: every target piece put in its place of the target ranges; the parts of a piece computed by several tasks are copied into it.

template moved_decided source · line 754 · raw

@-Element:Data -> @-Context:Data -> @-gather:Gather(Element, Context) -> @+context:Moving<Element, Context> -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @+count:U32 -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+fill:Element -> @sources:Sources<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template moved_with source · line 768 · raw

@-Element:Data -> @-Context:Data -> @-gather:Gather(Element, Context) -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+context:Context -> @+rows:F32 -> @+steps:F32 -> @sources:Sources<Element> -> @+origins:List<&2, Origin> -> @+target:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

The pieces of target cells, each component a task that reads only its own pieces of every source and gathers its target pieces. rows and steps count what one target cell adds to its move.

template view_written source · line 791 · raw

@-Element:Data -> @rest:Holdings<Element> -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template view_held source · line 795 · raw

@-Element:Data -> @+reversed:List<&2, Bool> -> @+extents:List<&2, U32> -> @+view:0xa2af805348d03b11eb853850859654f6/tensor_view.View -> @+count:U32 -> @+fill:Element -> @input:Holdings<Element> -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template view_gather source · line 802 · raw

@-Element:Data -> @+context:Viewed -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+first:U32 -> @+count:U32 -> @+fill:Element -> @input:Holdings<Element> -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

The target piece of first cell first and count cells read through the view.

template then_output source · line 812 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @+later:Later -> @+first:U32 -> @+count:U32 -> @result:Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template then_gather source · line 817 · raw

@-Element:Data -> @-Context:Data -> @-Later:Data -> @-gather:Gather(Element, Context) -> @-after:PieceMap(Element, Later) -> @+context:Then<Context, Later> -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+first:U32 -> @+count:U32 -> @+fill:Element -> @input:Holdings<Element> -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template unchanged source · line 823 · raw

@-Element:Data -> @+context:Unit -> @+first:U32 -> @+count:U32 -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>

The piece as it is.

template moved_counted source · line 826 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @+later:Later -> @empty:Bool -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+source:List<&2, U32> -> @+target:List<&2, U32> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+fill:Element -> @+workers:U32 -> Tensor<Element>

template placed_after source · line 849 · raw

@-Element:Data -> @waiting:Waiting<Element> -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Placed<Element>

template placed_joined source · line 854 · raw

@-Element:Data -> @placed:Placed<Element> -> Placed<Element>

The holdings of the later sources join the holding waiting for them.

template placed_sources source · line 860 · raw

@-Element:Data -> @segments:List<&2, List<&2, List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Segment>>> -> @sources:List<&2, List<&2, U32>> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+first:U32 -> @+count:U32 -> @input:Holdings<Element> -> @placed:Placed<Element> -> Placed<Element>

Every source writes the parts it places; the task calls no closure.

template placed_result source · line 871 · raw

@-Element:Data -> @placed:Placed<Element> -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template placing_gather source · line 877 · raw

@-Element:Data -> @+context:Placing -> @+components:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Components -> @+first:U32 -> @+count:U32 -> @+fill:Element -> @input:Holdings<Element> -> Pair(Holdings<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

A target piece starts as fill and takes from every source the parts of the piece that source places.

template placed_then source · line 889 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @+later:Later -> @+readings:List<&2, List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Reading>> -> @+segments:List<&2, List<&2, List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Segment>>> -> @sources:Sources<Element> -> @+origins:List<&2, Origin> -> @+target:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

The pieces of a target of shape target filled with fill where no source reaches, every source read as readings and placed as segments.

template placed_from source · line 894 · raw

@-Element:Data -> @+readings:List<&2, List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Reading>> -> @+segments:List<&2, List<&2, List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Segment>>> -> @sources:Sources<Element> -> @+origins:List<&2, Origin> -> @+target:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element)

template moved_status source · line 898 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @+later:Later -> @name:String -> @status:Status -> @valid:Bool -> @count:Maybe<&2, U32> -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+source:List<&2, U32> -> @+target:List<&2, U32> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> @+fill:Element -> @+workers:U32 -> Tensor<Element>

template moved_then source · line 909 · raw

@-Element:Data -> @-Later:Data -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @tensor:Tensor<Element> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> Tensor<Element>

The cells a view of a tensor's cells selects, in the view's row-major order with the flagged axes in reverse, as a tensor of the view's extents. Every component of the view is a task that reads only its own source pieces.

template moved source · line 915 · raw

@-Element:Data -> @name:String -> @tensor:Tensor<Element> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> @+reversed:List<&2, Bool> -> Tensor<Element>

template broadcast_status source · line 918 · raw

@-Element:Data -> @status:Status -> @view:Maybe<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.View> -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+shape:List<&2, U32> -> @+target:List<&2, U32> -> @+fill:Element -> @+workers:U32 -> Tensor<Element>

template broadcast_to source · line 926 · raw

@-Element:Data -> @tensor:Tensor<Element> -> @+target:List<&2, U32> -> Tensor<Element>

The tensor repeated to the extents target under NumPy broadcasting: one moving operation through the stretched view.

template combine_repeated_status source · line 930 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @status:Status -> @same:Bool -> @+shape:List<&2, U32> -> @+workers:U32 -> @repeated:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> Tensor<Element>

template combine_repeated source · line 939 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @same:Bool -> @+shape:List<&2, U32> -> @+workers:U32 -> @left:Tensor<Element> -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> Tensor<Element>

template combine_common source · line 947 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @operations:F32 -> @same:Bool -> @count:Maybe<&2, U32> -> @+shape:List<&2, U32> -> @+workers:U32 -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+left_shape:List<&2, U32> -> @+fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> Tensor<Element>

A left operand of the common extents keeps its pieces and every task reads the right through its stretched view. A left operand of other extents is first repeated to the common extents.

template combine_broadcast source · line 961 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @operations:F32 -> @status:Status -> @common:Maybe<&2, List<&2, U32>> -> @+workers:U32 -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+left_shape:List<&2, U32> -> @+left_fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> Tensor<Element>

Operands of other extents follow NumPy broadcasting (Shapes.broadcast) and fail only when they are incompatible.

template combine_shapes source · line 971 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @operations:F32 -> @same:Bool -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+left_shape:List<&2, U32> -> @+left_fill:Element -> @left_status:Status -> @left_workers:U32 -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> @right_status:Status -> @right_workers:U32 -> Tensor<Element>

template combine_with source · line 986 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @operations:F32 -> @left:Tensor<Element> -> @right:Tensor<Element> -> Tensor<Element>

operation(left element, right element), then after on every result piece in the same task. Operands of equal extents zip piece by piece; operands of other extents follow NumPy broadcasting (Shapes.broadcast) and fail only when they are incompatible. operations counts the vector rows of the operation on one cell for the parallel decision.

template combine_viewed_status source · line 996 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @status:Status -> @+workers:U32 -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+left_shape:List<&2, U32> -> @+left_fill:Element -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> @+right_shape:List<&2, U32> -> @right_fill:Element -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> Tensor<Element>

operation(left element, right element) with the right read through a view of it with the extents of the left, then after on every result piece in the same task.

template combine_viewed_with source · line 1005 · raw

@-Element:Data -> @-Later:Data -> @-kernel:Kernel(Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @left:Tensor<Element> -> @right:Tensor<Element> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> Tensor<Element>

template combine_viewed source · line 1013 · raw

@-Element:Data -> @-Later:Data -> @-operation:(@_:Element -> @_:Element -> Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @operations:F32 -> @left:Tensor<Element> -> @right:Tensor<Element> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+offset:U32 -> Tensor<Element>

The elementwise form: the kernel applies operation to each pair in order.

template combine source · line 1017 · raw

@-Element:Data -> @-Later:Data -> @-operation:(@_:Element -> @_:Element -> Element) -> @-after:PieceMap(Element, Later) -> @later:Later -> @name:String -> @operations:F32 -> @left:Tensor<Element> -> @right:Tensor<Element> -> Tensor<Element>

template expected_storage source · line 1049 · raw

@-Element:Data -> @result:Result<&2, &1, Problem, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>> -> IO(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)

template expect_storage source · line 1054 · raw

@-Element:Data -> @tensor:Tensor<Element> -> IO(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>)