def copy_allocated

bendtorch-core@0.1.0.0 · src/tensor/transforms.bend:235

import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
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/layout.bend as Layout

235def copy_allocated(+input: Shape.Shape, +axes: List<&2, U32>, +plan: Layout.Plan<input, axes>,
236  source: Core.Tensor<input>, allocated: Result<&2, &1, Core.Error, Core.Tensor<Layout.output(input, axes, plan)>>) ->
237  Core.Tensor<input> & Result<&2, &1, Error, Core.Dynamic>:
238  match allocated:
239    case Fail{error}:
240      (source, Fail{TensorError{error}})
241    case Done{target}:
242      copy_pack(input, axes, plan, built(input, axes, plan, source, target))

Uses (14)

Used by (5)