ReduceLAWS.fiber: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS.bend as ReduceLAWS Lines 49-58 of bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS.bend&start_line=49&end_line=58 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 # The specified accumulation: start at +0.0 and visit contribution positions # 0, 1, ..., count - 1 in ascending order; each position whose independent # broadcast projection, Projection.offset_spec, has target_offset equal to # target_index adds the word at its source_offset with one F32 add. def fiber(+plan: Shape.BroadcastPlan, +values: List<&2, F32>, +target_index: U32, +count: Nat) -> Maybe<&2, F32>: match count: case 0n: Some{0.0} case 1n+position: contribute(values, target_index, fiber(plan, values, target_index, position), Projection.offset_spec(plan, position)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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/autograd/reduce_LAWS.bend&name=contribute https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=BroadcastPlan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/projection_LAWS.bend&name=offset_spec