def kept_one

bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:522

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
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

522def kept_one(+target: Nat, +shape: Shape.Shape, gradient: Core.Dynamic, mine: Bool, rest: List<&1, Contribution>) ->
523  List<&1, Contribution>:
524  match mine:
525    case True{}:
526      rest
527    case False{}:
528      Contribution{target, shape, gradient} <> rest

Uses (6)

Used by (2)