type FromValuesContract
bendtorch-core@0.1.0.0 · src/tensor/from_values_records.bend:7
import bendtorch-core@0.1.0.0/src/tensor/from_values_records.bend as FromValuesRecords
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/allocation_spec.bend as Allocation
import bendtorch-core@0.1.0.0/src/tensor/observation.bend as Observation
7type FromValuesContract<-shape: Shape.Shape, -values: List<&2, F32>> is Type:
8 FromValuesContract{
9 successful: {Result.is_done(&2, &1, Core.Error, Core.Tensor<shape>, Core.from_values(shape, values)) == True{} : Bool},
10 dimensions: {Observation.dimensions(shape, Core.from_values(shape, values)) == Some{Shape.dimensions(shape)} : Maybe<&2, List<&2, U32>>},
11 count: {Allocation.tensor_length(shape, Core.from_values(shape, values)) == Some{Shape.logical_numel(Shape.dimensions(shape))} : Maybe<&2, Nat>},
12 word_count: {Observation.count(shape, Core.from_values(shape, values)) == Some{Shape.count(shape)} : Maybe<&2, U32>},
13 value: @+index: U32 -> @inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool} ->
14 {Observation.point(shape, index, Core.from_values(shape, values)) == List.get(&2, F32, values, U32.to_nat(index)) : Maybe<&2, F32>}}