def kept_others
import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackwardimport Base
530# The contributions to every node but id, in order.
531def kept_others(+id: Nat, items: List<&1, Contribution>) -> List<&1, Contribution>:
532 match items:
533 case Nil{}:
534 Nil{}
535 case Con{Contribution{+target, +shape, gradient}, rest}:
536 kept_one(target, shape, gradient, Nat.is_eq(id, target), kept_others(id, rest))