code: public SDVariable grad(String varName) {
          if (!sameDiffFunctionInstances.containsKey("grad")) {
              throw new IllegalStateException("Unable to obtain gradient. Please run execBackwards() first.");
          }
  
          SameDiff grad = getFunction("grad");
          SDVariable var = grad.getVariable(varName);
          return getFunction("grad").getGradForVariable(var.getVarName());
      }
docs: Get the gradient for the variable with the specified variable name.
  Note that in order to run this function, {@link #execBackwards()} must be executed first.
  All gradient functions are obtained from the results of the execBackwards call.
  
  @param varName the variable name to get the gradient variable for.
  @return The gradient variable for the specified variable