law accumulate_wrong_shape_refused

bendtorch-core@0.1.0.0 · src/autograd/gradient_LAWS.bend:172

import bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend as GradientLAWS
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
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient

172# A contribution whose dimensions differ from the slot's is refused with
173# ShapeMismatch, and the slot and the contribution come back unchanged, even
174# when the element counts agree ([3, 2] or [6] for a [2, 3] slot).
175law accumulate_wrong_shape_refused:
176  for +shape: Shape.Shape
177  for slot: Gradient.Slot
178  for contribution: Core.Dynamic
179  for differ: {Totality.dimensions(contribution) != Shape.dimensions(shape) : List<&2, U32>}
180  {Gradient.accumulate(shape, slot, contribution) == Gradient.Refused{slot, contribution, Gradient.ShapeMismatch{}} : Gradient.Outcome}

Uses (13)

Used by (0)

No other definition uses this definition.