type PermuteContract

bendtorch-core@0.1.0.0 · src/tensor/permute_values_records.bend:15

import bendtorch-core@0.1.0.0/src/tensor/permute_values_records.bend as PermuteValuesRecords
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis
import bendtorch-core@0.1.0.0/src/tensor/observation.bend as Values
import bendtorch-core@0.1.0.0/src/tensor/transform_observation.bend as Observation

15type PermuteContract<-input: Shape.Shape, -values: List<&2, F32>, -axes: List<&2, U32>> is Type:
16  PermuteContract{
17    outcome: {Observation.failure_code(input, Observation.Permute{axes}, Core.from_values(input, values)) == Some{0} : Maybe<&2, U32>},
18    dimensions: {Observation.applied_dimensions(input, Observation.Permute{axes}, Core.from_values(input, values)) ==
19      Some{Axis.order(U32, Shape.dimensions(input), Shape.naturals(axes))} : Maybe<&2, List<&2, U32>>},
20    count: {Observation.applied_length(input, Observation.Permute{axes}, Core.from_values(input, values)) ==
21      Some{Shape.logical_numel(Shape.dimensions(input))} : Maybe<&2, Nat>},
22    word_count: {Observation.applied_count(input, Observation.Permute{axes}, Core.from_values(input, values)) == Some{Shape.count(input)} : Maybe<&2, U32>},
23    value: @+index: U32 -> @inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(input))) == True{} : Bool} ->
24      {Observation.applied_value(input, Observation.Permute{axes}, index, Core.from_values(input, values)) ==
25        Values.listed(values, Values.permute_source(input, axes, index)) : Maybe<&2, F32>},
26    retained_value: @+other: U32 -> @inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(input))) == True{} : Bool} ->
27      {Observation.kept_value(input, Observation.Permute{axes}, other, Core.from_values(input, values)) ==
28        List.get(&2, F32, values, U32.to_nat(other)) : Maybe<&2, F32>}}

Uses (25)

Used by (2)