anchor.diff:                  // calculate Jacobians w.r.t. all variables
                   value.Expr |> computeWithRootJacobian incomingJacobian)    
               |> Seq.reduce merge
  -
   
           // go through portContents and create actual port contents
           let ports =
  
positive.code:                 dExpr0.Shape.[0]
              | [] -> failwith "output derivatives invalid"
  
          let portType p =
              spec.Channels.[p].Expr.Type
  
          let portSliceShape p =
              spec.Channels.[p].Expr.Shape |> ShapeSpec.withoutAxis spec.Channels.[p].SliceDim
  
          let portSliceElems p =
              p |> portSliceShape |> ShapeSpec.nElem
  
          /// argument of the derivative loop expression
          let args = ResizeArray<ExprT> originalArgs
  
  
negative.code:             | IterationsRemaining -> 
                  // iteration index is an intergral constant
                  ()        
              
          /// derivatives of all ports w.r.t. all variables
          let portDerivs =
  