type CellAt

bendtorch-core@0.1.0.0 · src/tensor/batched_matmul_LAWS.bend:98

import bendtorch-core@0.1.0.0/src/tensor/batched_matmul_LAWS.bend as BatchedMatmulLAWS
import Base
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as Batched
import bendtorch-core@0.1.0.0/src/tensor/dot_fold.bend as DotFold

98# What cell `position` of a build under the layout holds below the count:
99# the fold, from +0.0 in increasing k, of the `inner` factor pairs that
100# start at the cell's first reads (`Batched.left_start`, which reads the
101# left operand's own batch of the cell's batch, a stretched batch axis at
102# 0, and the cell's row; `Batched.right_start` the same for the right
103# operand and the cell's column) and step by each operand's stride.
104type CellAt<-dl: Nat, -dr: Nat, -A: Array<F32>, -B: Array<F32>, -lo: Matrix.Order, -ro: Matrix.Order, -inner: Nat, -rows: Nat,
105  -columns: Nat, -l1: Nat, -l2: Nat, -r1: Nat, -r2: Nat, -o2: Nat, -position: Nat, -value: Maybe<&2, F32>> is Data:
106  CellAt{-word: F32, -observed: {value == Some{word} : Maybe<&2, F32>}, -values: List<&2, DotFold.Factors>,
107    -logical: Strided(inner, dl, dr, A, B, Matrix.stride(lo, rows), Matrix.stride(ro, columns),
108      Batched.left_start(layout_of(lo, ro, inner, rows, columns, l1, l2, r1, r2, o2), position),
109      Batched.right_start(layout_of(lo, ro, inner, rows, columns, l1, l2, r1, r2, o2), position), values),
110    -fold: {word == DotFold.dot_fold(values, 0.0) : F32}}

Uses (13)

Used by (4)