def allocate_at_length
bendtorch-core@0.1.0.0 · src/tensor/allocation_PROOF.bend:25
import bendtorch-core@0.1.0.0/src/tensor/allocation_PROOF.bend as AllocationPROOF
import Base
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/tensor/allocation_spec.bend as Allocation
25def allocate_at_length(+length: Nat, +fill: F32, metadata: Nat & Nat,
26 valid: {Storage.bounds(Pair.fst(Nat, Nat, metadata), length) == True{} : Bool}) ->
27 {Allocation.storage_length(Storage.allocate_at(length, fill, metadata)) == Some{length} : Maybe<&2, Nat>}:
28 (+depth, capacity) = metadata
29 allocate_length(depth, length, fill, Storage.bounds(depth, length), {==}, valid)