function gradients(lossFn, variables) {
	  // TODO(cais): The return type signature can be simplified if deeplearn makes
	  //   the corresponding type public.
	  var variableList = variables.map(function (variable) {
	    return variable.read();
	  });
	  var valudAndGrads = variableGrads(lossFn, variableList);
	  return variables.map(function (variable) {
	    return valudAndGrads.grads[variable.name];
	  });
	}
Returns the gradients of `variables` w.r.t. the return value of `lossFn`.
@param lossFn A function which returns a Scalar to be used as the function
  value (i.e., numerator) for differentiation.
@param variables List of variables to be used as the independent variables
  (i.e., denominator) for differentiation.
@returns An Array of gradients tensors.