def NTGoal

bendtorch-core@0.1.0.0 · src/autograd/tensor_vjp_PROOF.bend:653

import bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_PROOF.bend as TensorVjpPROOF
import 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/contracts/LAWS.bend as Contracts
import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward
import bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend as Laws
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/tensor/dot_fold.bend as DotFold

653# The record the MatmulNT VJP law concludes, for the plans the law names.
654def NTGoal(+a: Nat, +b: Nat, +left: Shape.Shape, +right: Shape.Shape, +shape: Shape.Shape,
655  +first: Matrix.Plan<shape, right>, +second: Matrix.Product<Matrix.Swapped{}, Matrix.Swapped{}, shape, left>,
656  +fill: F32, +ops: List<&2, StorageLaws.Op>, +left_fill: F32, +left_ops: List<&2, StorageLaws.Op>,
657  +right_fill: F32, +right_ops: List<&2, StorageLaws.Op>, pass: Backward.Pass) -> Type:
658  Laws.MatmulPairContract<a, left, Contracts.matrix_rows(shape, right, first), Contracts.matrix_columns(shape, right, first),
659    row => column => DotFold.dot_fold(Contracts.factors(row, column,
660      Contracts.matrix_inner(shape, right, first), Contracts.matrix_columns(shape, right, first),
661      shape, fill, ops, right, right_fill, right_ops, Contracts.matrix_inner(shape, right, first)), 0.0),
662    b, right,
663    Contracts.product_rows(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second),
664    Contracts.product_columns(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second),
665    row => column => DotFold.dot_fold(Contracts.product_factors(row, column, Matrix.Swapped{}, Matrix.Swapped{},
666      Contracts.product_inner(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second),
667      Contracts.product_rows(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second),
668      Contracts.product_columns(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second),
669      shape, fill, ops, left, left_fill, left_ops, Contracts.product_inner(Matrix.Swapped{}, Matrix.Swapped{}, shape, left, second)), 0.0),
670    pass>

Uses (19)

Used by (1)