Transforms.copy_loop: def of bendtorch-core@0.1.0.0
Import: import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
Lines 163-172 of bendtorch-core@0.1.0.0/src/tensor/transforms.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&start_line=163&end_line=172
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
def copy_loop(fuel: Nat, +input: Shape.Shape, +axes: List<&2, U32>, +plan: Layout.Plan,
source: Core.Tensor, target: Core.Tensor, +cursor: Nat) ->
Core.Tensor & Result<&2, &1, Error, Core.Tensor>:
match fuel:
case 0n:
(source, Done{target})
case 1n+p:
natural_next(input, axes, plan, cursor,
source => target => copy_loop(p, input, axes, plan, source, target, 1n+cursor),
natural_step(input, axes, plan, cursor, source, target))
Uses (13):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Tensor
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Plan
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=output
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=Error
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=natural_next
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=natural_step