def built_owned
bendtorch-core@0.1.0.0 · src/tensor/gather.bend:402
import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather
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
402def built_owned(+kind: Pass, +input: Shape.Shape, +output: Shape.Shape, +plan: Plan, +entries: List<&2, U32>, +depth: Nat, +length: Nat,
403 -valid: {Storage.bounds(depth, length) == True{} : Bool},
404 -exact: {length == Shape.logical_numel(Shape.dimensions(output)) : Nat},
405 source: Core.Tensor<input>) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
406 Core.TTensor{storage, fits} = source
407 match storage:
408 case Storage.Empty{}:
409 (Core.Packed{input, Core.TTensor{Storage.Empty{}, fits}}, built_empty(kind, output, plan, entries, depth, length, valid, exact))
410 case Storage.Owned{+d, +n, array, balanced, ok}:
411 built_cloned(kind, input, output, plan, entries, depth, length, valid, exact, d, n, array, Array.clone(F32, array), {==}, balanced, ok, fits)