def fiber
bendtorch-core@0.1.0.0 · src/autograd/reduce_LAWS.bend:49
import bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS.bend as ReduceLAWS
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/projection_LAWS.bend as Projection
49
50
51
52
53def fiber(+plan: Shape.BroadcastPlan, +values: List<&2, F32>, +target_index: U32, +count: Nat) -> Maybe<&2, F32>:
54 match count:
55 case 0n:
56 Some{0.0}
57 case 1n+position:
58 contribute(values, target_index, fiber(plan, values, target_index, position), Projection.offset_spec(plan, position))