Bug with gradient computation when the term is a variable.
description
The following code reproduces the bug:
Variable x = new Variable();
Variable y = new Variable();
Variable z = new Variable();
Term func = y;
double[] grad = func.Differentiate(new Variable[] {x, y, z}, new double[] {1, 2, 3 });