type CloneContract
bendtorch-core@0.1.0.0 · src/tensor/clone_metadata_records.bend:6
import bendtorch-core@0.1.0.0/src/tensor/clone_metadata_records.bend as CloneMetadataRecords
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/observation.bend as Observation
6type CloneContract<-shape: Shape.Shape, -fill: F32> is Type:
7 CloneContract{
8 first_dimensions: {Observation.clone_first_dimensions(shape, Core.new(shape, fill)) == Some{Shape.dimensions(shape)} : Maybe<&2, List<&2, U32>>},
9 second_dimensions: {Observation.clone_second_dimensions(shape, Core.new(shape, fill)) == Some{Shape.dimensions(shape)} : Maybe<&2, List<&2, U32>>},
10 first_count: {Observation.clone_first_length(shape, Core.new(shape, fill)) == Some{Shape.logical_numel(Shape.dimensions(shape))} : Maybe<&2, Nat>},
11 second_count: {Observation.clone_second_length(shape, Core.new(shape, fill)) == Some{Shape.logical_numel(Shape.dimensions(shape))} : Maybe<&2, Nat>},
12 first_word_count: {Observation.clone_first_count(shape, Core.new(shape, fill)) == Some{Shape.count(shape)} : Maybe<&2, U32>},
13 second_word_count: {Observation.clone_second_count(shape, Core.new(shape, fill)) == Some{Shape.count(shape)} : Maybe<&2, U32>},
14 first_value: @+other: U32 -> @inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool} ->
15 {Observation.clone_first_value(shape, other, Core.new(shape, fill)) == Some{fill} : Maybe<&2, F32>},
16 second_value: @+other: U32 -> @inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool} ->
17 {Observation.clone_second_value(shape, other, Core.new(shape, fill)) == Some{fill} : Maybe<&2, F32>}}