def cells
bendtorch-core@0.1.0.0 · src/tensor/contracts/binary_LAWS.bend:12
import bendtorch-core@0.1.0.0/src/tensor/contracts/binary_LAWS.bend as BinaryLAWS
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise.bend as Pointwise
import bendtorch-core@0.1.0.0/src/tensor/contracts/broadcast.bend as Broadcast
12
13
14
15def cells(+operation: Elementwise.Operation, +plan: Shape.BroadcastPlan,
16 +left: Shape.Shape, +left_fill: F32, +left_ops: List<&2, StorageLaws.Op>,
17 +right: Shape.Shape, +right_fill: F32, +right_ops: List<&2, StorageLaws.Op>, +count: Nat) -> List<&2, F32>:
18 match count:
19 case 0n:
20 Nil{}
21 case 1n+previous:
22 List.append(&2, F32, cells(operation, plan, left, left_fill, left_ops, right, right_fill, right_ops, previous),
23 [Pointwise.cell(~Elementwise.Operation, ~Elementwise.scalar, ~Shape.BroadcastPlan, ~Broadcast.left_map,
24 ~Broadcast.right_map, operation, plan, left, left_fill, left_ops, right, right_fill, right_ops, previous)])