TensorVjpLAWS.nt_reads_transpose: law of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend as TensorVjpLAWS Lines 442-468 of bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend&start_line=442&end_line=468 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/matmul.bend as Matrix import bendtorch-core@0.1.0.0/src/tensor/dot_fold.bend as DotFold import bendtorch-core@0.1.0.0/src/tensor/contracts/LAWS.bend as Contracts # matmul_nt reads what matmul reads from the transposed copy: for a right # operand of dimensions [columns, inner], the factor pairs of cell # (row, column) of a product of two `Kept` operands (`matmul_nt`), left[row, # k] and right[column, k], are the pairs `right_transposed_factors` reads # through `permute_source` on right^T, the pairs `tensor_matmul_vjp_values` # states for g @ y^T. Both fold the same words in the same order, so # `matmul_nt(g, y)` and `matmul(g, transpose_copy(y))` agree word for word. law nt_reads_transpose: for +row: Nat for +column: Nat for +rows: Nat for +left: Shape.Shape for +left_fill: F32 for +left_ops: List<&2, StorageLaws.Op> for +right: Shape.Shape for +right_fill: F32 for +right_ops: List<&2, StorageLaws.Op> for +columns: U32 for +inner: U32 for matrix: {Shape.dimensions(right) == [columns, inner] : List<&2, U32>} for column_below: {Nat.is_lt(column, U32.to_nat(columns)) == True{} : Bool} for +count: Nat for room: {Nat.is_le(count, U32.to_nat(inner)) == True{} : Bool} {Contracts.product_factors(row, column, Matrix.Kept{}, Matrix.Kept{}, U32.to_nat(inner), rows, U32.to_nat(columns), left, left_fill, left_ops, right, right_fill, right_ops, count) == right_transposed_factors(row, column, U32.to_nat(inner), U32.to_nat(columns), left, left_fill, left_ops, right, right_fill, right_ops, swapped(right), count) : List<&2, DotFold.Factors>} Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend&name=right_transposed_factors https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend&name=swapped https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_PROOF.bend&name=nt_factors https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/LAWS.bend&name=Op https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/contracts/LAWS.bend&name=product_factors https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/dot_fold.bend&name=Factors https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Order