law dot_ordered
import bendtorch-core@0.1.0.0/src/tensor/contracts/LAWS.bend as LAWSimport Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/dot_fold.bend as DotFold
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
import bendtorch-core@0.1.0.0/src/tensor/contracts/dot.bend as Dot
import bendtorch-core@0.1.0.0/src/tensor/contracts/fold_records.bend as FoldRecords
106# Ordered-fold family, dot instance: for every in-bounds output cell of a
107# product of a rows x inner and an inner x columns replayed matrix, the dot
108# product succeeds with `DotFold.dot_fold` of the cell's factor pairs in
109# increasing k, starting at +0.0, and both returned inputs keep every word.
110law dot_ordered:
111 for +rows: Nat
112 for +inner: Nat
113 for +columns: Nat
114 for +row: Nat
115 for row_below: {Nat.is_lt(row, rows) == True{} : Bool}
116 for +column: Nat
117 for column_below: {Nat.is_lt(column, columns) == True{} : Bool}
118 for +left: Shape.Shape
119 for left_extents: {Shape.extents(left) == [rows, inner] : List<&2, Nat>}
120 for +left_fill: F32
121 for +left_ops: List<&2, StorageLaws.Op>
122 for -left_fits: {Lifecycle.logical_length(Replayed.storage(left, left_fill, left_ops)) == Shape.logical_numel(Shape.dimensions(left)) : Nat}
123 for +right: Shape.Shape
124 for right_extents: {Shape.extents(right) == [inner, columns] : List<&2, Nat>}
125 for +right_fill: F32
126 for +right_ops: List<&2, StorageLaws.Op>
127 for -right_fits: {Lifecycle.logical_length(Replayed.storage(right, right_fill, right_ops)) == Shape.logical_numel(Shape.dimensions(right)) : Nat}
128 FoldRecords.PairFoldContract<left, right,
129 DotFold.dot_fold(factors(row, column, inner, columns, left, left_fill, left_ops, right, right_fill, right_ops, inner), 0.0),
130 other => Replayed.value(left, left_fill, left_ops, other),
131 other => Replayed.value(right, right_fill, right_ops, other),
132 Dot.dot(Dot.Cell{row, column, inner, columns},
133 Core.Packed{left, Core.TTensor{Replayed.storage(left, left_fill, left_ops), left_fits}},
134 Core.Packed{right, Core.TTensor{Replayed.storage(right, right_fill, right_ops), right_fits}})>
Uses (21)
Used by (0)
No other definition uses this definition.