def built_owned
bendtorch-core@0.1.0.0 · src/tensor/slice.bend:343
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
343def built_owned(+kind: Pass, +input: Shape.Shape, +output: Shape.Shape, +plan: Plan, +depth: Nat, +length: Nat,
344 -valid: {Storage.bounds(depth, length) == True{} : Bool},
345 -exact: {length == Shape.logical_numel(Shape.dimensions(output)) : Nat},
346 source: Core.Tensor<input>) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
347 Core.TTensor{storage, fits} = source
348 match storage:
349 case Storage.Empty{}:
350 (Core.Packed{input, Core.TTensor{Storage.Empty{}, fits}}, built_empty(kind, output, plan, depth, length, valid, exact))
351 case Storage.Owned{+d, +n, array, balanced, ok}:
352 built_cloned(kind, input, output, plan, depth, length, valid, exact, d, n, array, Array.clone(F32, array), {==}, balanced, ok, fits)