def take_lift
bendtorch-core@0.1.0.0 · src/tensor/matmul_PROOF.bend:1293
import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF
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/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as Parallel
1293def take_lift(+shape: Shape.Shape, a: Core.Tensor<shape>, -Q: Core.Dynamic & Array<F32> -> Type, h: KeptCopy(shape, a, Q)) ->
1294 Q(Elementwise.take(Core.Packed{shape, a})):
1295 Core.TTensor{storage, exact} = a
1296 match storage:
1297 case Storage.Empty{}:
1298 h(Core.TTensor{Storage.Empty{}, exact})(Array.new(F32, 0n, 0.0))(Parallel.taken(Core.Packed{shape, Core.TTensor{Storage.Empty{}, exact}}))
1299 case Storage.Owned{+depth, +length, array, balanced, valid}:
1300 take_owned_lift(shape, depth, length, array, Array.clone(F32, array), {==}, balanced, valid, exact, Q, h)