anchor.diff:          index))))
   
   (defmethod input-gradient ((reduction reduction) (output-gradient lazy-array) index)
  -  (cond ((eql (operator reduction) #'+)
  +  (cond ((member (operator reduction) (list '+ 'petalisp.type-inference:short-float+))
            (α #'* output-gradient (reshape 1 (shape (input reduction)))))
           (t
            (error "~@<Don't know how to compute the gradient of a reduction ~
  -                    of ~R arguments with the operator ~S.~:@>"
  +                    of ~R argument~:P with the operator ~S.~:@>"
                   (length (inputs reduction))
                   (operator reduction)))))
   
  
positive.code:   (with-accessors ((transformation transformation)
                     (shape shape)) reference
      (if (transformation-invertiblep transformation)
          (make-reference
           output-gradient
           (shape reference)
           (invert-transformation (transformation reference)))
          ;; The input gradient of a broadcasting reference is the average of
          ;; all incoming gradients.
          (let ((axes '()))
  
negative.code:   ;; describes the gradient at the corresponding input of this record's
    ;; lazy array.
    (input-gradient-caches nil :type vector))
  
  (defmethod print-object ((ad-record ad-record) stream)
    (print-unreadable-object (ad-record stream :type t :identity t)
      (format stream "~S" (ad-record-lazy-array ad-record))))
  
  (defmacro ad-record-input-gradient-cache (ad-record index)
    `(svref (ad-record-input-gradient-caches ,ad-record) ,index))
  