def from_values_new_elements

bendtorch-core@0.1.0.0 · src/tensor/construction_PROOF.bend:495

import bendtorch-core@0.1.0.0/src/tensor/construction_PROOF.bend as ConstructionPROOF
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/construction_LAWS.bend as Laws

495def from_values_new_elements(-shape: Shape.Shape, +values: List<&2, F32>,
496  result: Result<&2, &1, Core.Error, Core.Tensor<shape>>,
497  -count: {Shape.logical_numel(Shape.dimensions(shape)) == List.length(&2, F32, values) : Nat}) ->
498  ElementsOutcome<shape, values, Core.from_values_new(shape, values, result)>:
499  match result:
500    case Fail{error}:
501      ElementsOutcome{Unit{}}
502    case Done{tensor}:
503      ElementsOutcome{
504        {\{ElementsOutcome: meaning => meaning} : ElementsOutcome<shape, values, Core.fill_values(values, shape, tensor, 0n)> ->
505          Laws.FromValuesMeaning(shape, values, Core.fill_values(values, shape, tensor, 0n))}(complete_fill(shape, values, tensor,
506            Core.fill_values(values, shape, tensor, 0n), count,
507            {\{FillOutcome: meaning => meaning} : FillOutcome<shape, tensor, values, 0n, Core.fill_values(values, shape, tensor, 0n)> ->
508              FillMeaning(shape, tensor, values, 0n, Core.fill_values(values, shape, tensor, 0n))}(fill_model(values, shape, tensor, 0n))))}

Uses (19)

Used by (1)