void BackwardBreadth_ <T>(Scalar <T> target)
        {
            var delta = (Scalar <T>)_scalarDerivatives[target];

            if (delta == null)
            {
                return;
            }

            target.Backward(delta, this);
        }
        public void PushGradientTo <T>(Scalar <T> target, Scalar <T> delta)
        {
            if (delta.IsZero)
            {
                return;
            }

            if (!_scalarDerivatives.ContainsKey(target))
            {
                _scalarDerivatives[target] = delta;
            }
            else
            {
                _scalarDerivatives[target] = (Scalar <T>)_scalarDerivatives[target] + delta;
            }

            if (!firstPass)
            {
                if (!nodeQueue.Contains(target))
                {
                    nodeQueue.AddFirst(target);
                }
                deltaReceived[target] -= 1;
            }
            else
            {
                if (incrementTargetInputs)
                {
                    if (!deltaReceived.ContainsKey(target))
                    {
                        deltaReceived[target] = 1;
                    }
                    else
                    {
                        deltaReceived[target] += 1;
                    }
                }

                var duplicated = visited.Contains(target);
                if (duplicated)
                {
                    needSecondPass += 1;
                }

                var copy = incrementTargetInputs;
                incrementTargetInputs = incrementTargetInputs && !duplicated;
                visited.Add(target);

                target.Backward(delta, this);
                incrementTargetInputs = copy;
            }
        }