PermuteValuesContractLAWS.transpose_replayed: law of bendtorch-core@0.1.0.0
Import: import bendtorch-core@0.1.0.0/src/tensor/permute_values_contract_LAWS.bend as PermuteValuesContractLAWS
Lines 53-68 of bendtorch-core@0.1.0.0/src/tensor/permute_values_contract_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/permute_values_contract_LAWS.bend&start_line=53&end_line=68
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend as Transpose
import bendtorch-core@0.1.0.0/src/tensor/permute_values_records.bend as Records
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/transforms.bend as Transforms
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
# `transpose_dynamic(a, b)` of a replayed tensor with both axes in range is the
# permute of `permute_replayed` by the swapped axes, in the same transport form.
law transpose_replayed:
for +input: Shape.Shape
for +fill: F32
for +ops: List<&2, StorageLaws.Op>
for -fits: {Lifecycle.logical_length(Replayed.storage(input, fill, ops)) == Shape.logical_numel(Shape.dimensions(input)) : Nat}
for +a: U32
for +b: U32
for inside: {True{} == Transpose.valid(input, a, b) : Bool}
for +plan: Layout.Plan
for laid: {Layout.permutation(input, Transpose.swapped_axes(input, a, b)) == Done{plan} :
Result<&2, &2, Layout.Error, Layout.Plan>}
for -P: Core.Dynamic & Result<&2, &1, Transforms.Error, Core.Dynamic> -> Type
for h: Records.PermutedWith(input, fill, ops, Transpose.swapped_axes(input, a, b), plan, P)
P(Transforms.transpose_dynamic(Core.Packed{input, Core.TTensor{Replayed.storage(input, fill, ops), fits}}, a, b))
Uses (24):
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=Pair
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32
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/shape/core.bend&name=logical_numel
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/replayed.bend&name=storage
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Tensor
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Error
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Plan
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=permutation
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend&name=logical_length
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/permute_values.bend&name=transpose_replayed
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/permute_values_records.bend&name=PermutedWith
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=Error
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=transpose_dynamic
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend&name=swapped_axes
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend&name=valid